-
Notifications
You must be signed in to change notification settings - Fork 925
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
077e337
to
a7699f5
Compare
2a37b9b
to
a33fad3
Compare
a7699f5
to
f861c42
Compare
There 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
to
1d27539
Compare
a33fad3
to
9245e87
Compare
7349e1f
to
043cd58
Compare
1d27539
to
ac9d0e6
Compare
043cd58
to
37c71f1
Compare
ac9d0e6
to
6b4dabf
Compare
6b4dabf
to
1e1cb20
Compare
37c71f1
to
c1b35bf
Compare
1e1cb20
to
cb43418
Compare
Parallel concurrent queries cannot be run in the same tx
cb43418
to
a908ce6
Compare
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