Skip to content

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

Merged
MichaelMure merged 1 commit into
trunkfrom
bridge-lock
Oct 15, 2026
Merged

MichaelMure merged 1 commit into
trunkfrom
bridge-lock

Conversation

@MichaelMure

@MichaelMure MichaelMure commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; the remaining cancellation-reporting issue is non-blocking.

Findings

  1. P2 Cancelled pull appears complete ▶

Summary

Adds a repository-wide bridge.lock so bridge imports and exports cannot run together.

  • Bridge imports and exports take turns in each repository.
  • Cancelled imports no longer advance the saved resume time.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Import or export] --> B{Create bridge.lock}
  B -->|Already exists| C[Return ErrBridgeRunning]
  B -->|Created| D[Configure and initialize]
  D -->|Error| E[Remove lock and return error]
  D -->|Ready| F[Run bridge and relay events]
  F --> G[Event stream ends]
  G --> H[Remove lock and close output]
Loading

Reviews (4) · Last reviewed commit: "bridge: add a dedicated lock to avoid co..." · Reviewed by Greptile

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

go func() {
defer close(out)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Cancelled pull appears complete

When a Launchpad pull is cancelled after SearchTasks returns, closing this channel lets the relay finish without receiving an error event. It then records lastImportTime, and the CLI reports a completed import even though some tasks were not processed. This makes it harder to tell that the pull stopped early and may cause later pulls to resume from the wrong checkpoint.

@MichaelMure
MichaelMure enabled auto-merge October 15, 2026 21:05
@MichaelMure
MichaelMure added this pull request to the merge queue Oct 15, 2026
Merged via the queue into trunk with commit 79bf709 Oct 15, 2026
13 checks passed
@MichaelMure
MichaelMure deleted the bridge-lock branch October 15, 2026 21:12
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