Skip to content

/{driver,open_serialization_test}.go: serialize open calls#214

Merged
coffeegoddd merged 3 commits into
mainfrom
db/isolate-open-calls
Mar 23, 2026
Merged

/{driver,open_serialization_test}.go: serialize open calls#214
coffeegoddd merged 3 commits into
mainfrom
db/isolate-open-calls

Conversation

@coffeegoddd
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

Copilot AI 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 introduces process-wide serialization for embedded engine initialization to avoid concurrent access to global mutable state inside go-mysql-server (GMS), and adds tests to validate both serialization and context-cancellation behavior.

Changes:

  • Add a process-level semaphore around openSqlEngine to ensure only one engine open happens at a time.
  • Respect ctx.Done() while waiting to acquire the semaphore and return ctx.Err() when cancelled.
  • Add tests to verify concurrent opens are serialized and that blocked opens respect context deadlines.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
driver.go Adds a process-level semaphore to serialize openSqlEngine calls and handles context cancellation while waiting.
open_serialization_test.go Adds new tests covering open serialization across connectors and cancellation while blocked on the semaphore.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread open_serialization_test.go Outdated
Comment thread open_serialization_test.go
@coffeegoddd coffeegoddd requested a review from reltuk March 23, 2026 21:16
Copy link
Copy Markdown
Contributor

@reltuk reltuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@coffeegoddd coffeegoddd merged commit c0763e2 into main Mar 23, 2026
3 checks passed
@coffeegoddd coffeegoddd deleted the db/isolate-open-calls branch March 23, 2026 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants