- Notifications
You must be signed in to change notification settings - Fork924
chore: remove parallel queries in the same transaction#18489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Emyrk commentedJun 23, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
This stack of pull requests is managed byGraphite. Learn more aboutstacking. |
077e337
toa7699f5
Compare2a37b9b
toa33fad3
Comparea7699f5
tof861c42
CompareThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull Request Overview
This PR removes the use of parallel queries within a single transaction to avoid concurrent query issues with PostgreSQL. It refactors query execution to run sequentially with updated error wrapping for clarity.
- Removed the use of errgroup for concurrent query execution.
- Updated error handling with xerrors.Errorf wrappers.
- Refactored variable declarations for query results.
Comments suppressed due to low confidence (3)
coderd/dynamicparameters/render.go:323
- The variable 'key' is used outside of its declaration block, making it unavailable when constructing the WorkspaceOwner struct. Consider declaring 'key' in the outer scope before its assignment so that its value can be properly accessed later.
SSHPublicKey: key.PublicKey,
coderd/dynamicparameters/render.go:311
- The 'groupNames' variable is declared locally using a short declaration, which may limit its scope. It should be declared in the outer scope to ensure it is accessible when constructing the WorkspaceOwner struct.
groupNames := make([]string, 0, len(groups))
coderd/dynamicparameters/render.go:277
- The 'ownerRoles' variable is being declared with a short assignment inside a block, which may restrict its scope and lead to a runtime error when accessed later. Consider declaring it in an outer scope so that it remains accessible when needed.
ownerRoles := make([]previewtypes.WorkspaceOwnerRBACRole, 0, len(roles))
f861c42
to1d27539
Comparea33fad3
to9245e87
Compare7349e1f
to043cd58
Compare1d27539
toac9d0e6
Compare043cd58
to37c71f1
Compareac9d0e6
to6b4dabf
Compare6b4dabf
to1e1cb20
Compare1e1cb20
tocb43418
CompareParallel concurrent queries cannot be run in the same tx
cb43418
toa908ce6
Compare7254c08
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Parallel concurrent queries cannot be run in the same tx
Was getting this error:https://stackoverflow.com/questions/78472996/go-postgres-pq-unexpected-parse-response-c-with-queryrow