Skip to content

bridge: add a dedicated lock to avoid concurrent run - #1674

Open
MichaelMure wants to merge 1 commit into
trunkfrom
bridge-lock
Open

MichaelMure wants to merge 1 commit into
trunkfrom
bridge-lock

Conversation

@MichaelMure

@MichaelMure MichaelMure commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR has no newly established blocking issue, but callers that abandon a result stream can still retain the bridge lock.

Findings

  1. P2 Abandoned streams retain lock ▶
Summary

The PR adds a repository-wide file lock around bridge imports and exports, and closes the Launchpad importer’s event channel when its worker exits.

  • Lock acquisition rejects overlapping bridge runs; cleanup releases the lock after the result stream finishes.
  • The outstanding concern is the previously reported lock retention when a caller abandons a result stream.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Import or export requested] --> B{Acquire bridge.lock}
  B -- Already exists --> C[Return ErrBridgeRunning]
  B -- Acquired --> D[Run bridge and relay events]
  D --> E[Result stream finishes]
  E --> F[Release bridge.lock]
Loading

Reviews (2) · Last reviewed commit: "bridge: add a dedicated lock to avoid co..."

Comment thread bridge/core/bridge.go
Comment thread bridge/core/bridge.go
Comment thread bridge/core/bridge.go

This branch has not been deployed

No deployments
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.

1 participant