Skip to content

fix(gatewayidentity): serialize marker transitions - #861

Merged
frahlg merged 1 commit into
masterfrom
agent/fix-binding-marker-transition
Aug 7, 2026
Merged

frahlg merged 1 commit into
masterfrom
agent/fix-binding-marker-transition

Conversation

@frahlg

@frahlg frahlg commented Aug 7, 2026

Copy link
Copy Markdown
Member

What changed

  • take a short directory lock around ReplaceExact when the caller does not already hold the binding transaction lock
  • keep a caller-owned transaction lock held until Close
  • add a Linux regression test for that lock scope

Why

Concurrent stores could all read pending, then replace the marker with separate inodes containing the same active bytes. A losing read could see those valid inode changes for all retry attempts and return binding file state changed before return.

The lock lets one store finish the marker change. The other stores then read the same active bytes and return success. File, directory, owner, link and content checks remain unchanged.

Impact

The public binding entry points already hold the directory lock across the full binding transaction, so their lock scope does not change. Direct storage transitions now follow the same ordering and the Linux CI test no longer depends on timing.

Checks

  • Linux test binary: target tests, -count=500
  • Linux race detector: target tests, -count=50
  • full Linux gatewayidentity package
  • make verify
  • pre-push make verify-all

Fixes #833

@frahlg frahlg added the no-changeset PR intentionally exempt from the changeset requirement (dev tooling / non-shipping) label Aug 7, 2026 — with ChatGPT Codex Connector
@frahlg
frahlg force-pushed the agent/fix-binding-marker-transition branch from 50eaccc to 5cf9051 Compare August 7, 2026 06:20

frahlg commented Aug 7, 2026

Copy link
Copy Markdown
Member Author

Rebased onto current master (899205b5511bfabcefd1aed09967ca6b68090419). New head: 5cf90513e83cc40b8ca91bbcb76609c8f00c34ea.

  • No other open PR changes either file.
  • No reviews or review threads.
  • No CODEOWNERS rule covers these files.
  • Race tests passed for gatewayidentity and configreload together.
  • The Linux gatewayidentity test binary builds.
  • The pre-push hook passed full make verify-all.

Marking this ready and waiting for the fresh GitHub checks before squash merge.

@frahlg
frahlg marked this pull request as ready for review August 7, 2026 06:20
@frahlg
frahlg merged commit aa57e8b into master Aug 7, 2026
13 checks passed

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5cf90513e8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +522 to +524
if !s.transactionLockHeld {
if err := lockLinuxBindingDirectory(s.dir); err != nil {
return fmt.Errorf("lock binding directory for transition: %w", err)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Add a changeset for the binding reliability fix

This changes user-visible adoption behavior by preventing concurrent marker transitions from failing, but the commit adds no .changeset/*.md entry. Consequently, the changeset gate will reject the change unless manually overridden, and the fix will not independently drive versioning or release notes; add a changeset describing the gateway-identity reliability correction.

AGENTS.md reference: AGENTS.md:L109-L114

Useful? React with 👍 / 👎.

@frahlg
frahlg deleted the agent/fix-binding-marker-transition branch August 8, 2026 05:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changeset PR intentionally exempt from the changeset requirement (dev tooling / non-shipping)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky test: TestLinuxBindingConcurrentMarkerTransition — "binding file state changed before return"

1 participant