Skip to content

Clarify lazy runtime Close concurrency semantics - #75

Merged
apstndb merged 1 commit into
mainfrom
apstndb/issue-39-lazy-close
Jul 1, 2026
Merged

Clarify lazy runtime Close concurrency semantics#75
apstndb merged 1 commit into
mainfrom
apstndb/issue-39-lazy-close

Conversation

@apstndb

@apstndb apstndb commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Clarifies the conservative LazyRuntime/LazyEmulator invariant for concurrent first Get/Setup and Close, including the Get-wins and Close-wins outcomes.
  • Adds race-detector-friendly lazy state tests for Close-before-start, concurrent Get-and-Close, and Close after startup panic.

Fixes #39.

Test plan

  • go test -race -run 'TestLazy' ./...
  • TESTCONTAINERS_RYUK_DISABLED=true go test -race ./...
  • git diff --check

Made with Cursor

Document the conservative Close-vs-first-use invariant and add race-friendly lazy state tests so the edge case remains stable.

Co-authored-by: Cursor <cursoragent@cursor.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the documentation for LazyEmulator and LazyRuntime to clarify their concurrent lifecycle invariants, specifically detailing how concurrent initialization (Get/Setup) and cleanup (Close) are serialized. Additionally, it introduces new unit tests in lazy_test.go to verify these behaviors, including edge cases like closing after a panic, closing before initialization, and concurrent get and close operations. I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@apstndb
apstndb merged commit 38dcecc into main Jul 1, 2026
4 checks passed
@apstndb
apstndb deleted the apstndb/issue-39-lazy-close branch July 1, 2026 16:16
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.

lazy: clarify Close versus in-flight Get semantics

1 participant