Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
Emyrk merged 1 commit intomainfromstevenmasley/sequential_query
Jun 23, 2025

Conversation

Emyrk
Copy link
Member

@EmyrkEmyrk commentedJun 23, 2025
edited
Loading

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

@EmyrkGraphite App
Copy link
MemberAuthor

Emyrk commentedJun 23, 2025
edited
Loading

@EmyrkEmyrk marked this pull request as ready for reviewJune 23, 2025 01:40
@EmyrkEmyrk changed the base branch fromstevenmasley/parameters_to_preview tographite-base/18489June 23, 2025 05:12
@EmyrkEmyrkforce-pushed thestevenmasley/sequential_query branch from077e337 toa7699f5CompareJune 23, 2025 05:13
@EmyrkEmyrk changed the base branch fromgraphite-base/18489 tostevenmasley/deadlock_fetchJune 23, 2025 05:13
@EmyrkEmyrk requested a review fromaslilacJune 23, 2025 06:07
@EmyrkEmyrkforce-pushed thestevenmasley/deadlock_fetch branch from2a37b9b toa33fad3CompareJune 23, 2025 06:07
@EmyrkEmyrkforce-pushed thestevenmasley/sequential_query branch froma7699f5 tof861c42CompareJune 23, 2025 06:07
@EmyrkEmyrk requested a review fromCopilotJune 23, 2025 12:25
Copy link
Contributor

@CopilotCopilotAI left a 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))

@EmyrkEmyrkforce-pushed thestevenmasley/deadlock_fetch branch 2 times, most recently from7349e1f to043cd58CompareJune 23, 2025 16:32
@EmyrkEmyrkforce-pushed thestevenmasley/sequential_query branch from1d27539 toac9d0e6CompareJune 23, 2025 16:32
@EmyrkEmyrkforce-pushed thestevenmasley/deadlock_fetch branch from043cd58 to37c71f1CompareJune 23, 2025 16:45
@EmyrkEmyrkforce-pushed thestevenmasley/sequential_query branch fromac9d0e6 to6b4dabfCompareJune 23, 2025 16:45
@EmyrkEmyrk changed the base branch fromstevenmasley/deadlock_fetch tographite-base/18489June 23, 2025 16:58
@EmyrkEmyrkforce-pushed thestevenmasley/sequential_query branch from6b4dabf to1e1cb20CompareJune 23, 2025 16:59
@EmyrkEmyrkforce-pushed thegraphite-base/18489 branch from37c71f1 toc1b35bfCompareJune 23, 2025 16:59
@graphite-appgraphite-appbot changed the base branch fromgraphite-base/18489 tomainJune 23, 2025 16:59
@EmyrkEmyrkforce-pushed thestevenmasley/sequential_query branch from1e1cb20 tocb43418CompareJune 23, 2025 16:59
Parallel concurrent queries cannot be run in the same tx
@EmyrkEmyrkforce-pushed thestevenmasley/sequential_query branch fromcb43418 toa908ce6CompareJune 23, 2025 17:04
@EmyrkEmyrk merged commit7254c08 intomainJun 23, 2025
35 checks passed
@EmyrkEmyrk deleted the stevenmasley/sequential_query branchJune 23, 2025 17:18
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJun 23, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

Copilot code reviewCopilotCopilot left review comments

@aslilacaslilacaslilac approved these changes

Assignees

@EmyrkEmyrk

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@Emyrk@aslilac

[8]ページ先頭

©2009-2025 Movatter.jp