Skip to content

fix: handle concurrent node connection establishment - #1875

Open
0utplay wants to merge 1 commit into
nightlyfrom
fix/concurrent-node-connection
Open

fix: handle concurrent node connection establishment#1875
0utplay wants to merge 1 commit into
nightlyfrom
fix/concurrent-node-connection

Conversation

@0utplay

@0utplay 0utplay commented Aug 9, 2026

Copy link
Copy Markdown
Member

Motivation

When multiple nodes are configured and one of them starts and tries to connect to the other ones (in parallel) a concurrent write on the existing LinkedList would cause issues in the second step where unavailable nodes would get removed.

Modification

Replaced the phaser implementation with a stream and a future wrapping all connection futures

Result

No more exceptions on startup

Other context

Fixes https://discord.com/channels/325362837184577536/818777626663321671/1535395256055627889

@0utplay
0utplay requested a lite review from Copilot August 9, 2026 18:59
@0utplay 0utplay self-assigned this Aug 9, 2026
@0utplay 0utplay added v: 4.X This pull should be included in the 4.0 release in: node An issue/pull request releated to the node module code t: fix A pull request introducing a fix for a bug. labels Aug 9, 2026
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

Test Results

 56 files  ±0   56 suites  ±0   3m 52s ⏱️ +21s
571 tests ±0  571 ✅ ±0  0 💤 ±0  0 ❌ ±0 
938 runs  ±0  938 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 044b02b. ± Comparison against base commit f3ed7a6.

Copilot AI 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.

Pull request overview

This PR fixes a startup-time concurrency issue during parallel node connection establishment by removing shared mutable state updates from asynchronous completion callbacks and instead aggregating connection outcomes after all connection attempts finish.

Changes:

  • Replace Phaser + concurrently-mutated LinkedList approach with a CompletableFuture.allOf(...) aggregation.
  • Collect per-node “wait until available” suppliers only after all connection futures complete, avoiding concurrent writes/removals.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@0utplay
0utplay marked this pull request as ready for review August 10, 2026 11:54
@0utplay
0utplay requested a review from derklaro August 10, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: node An issue/pull request releated to the node module code t: fix A pull request introducing a fix for a bug. v: 4.X This pull should be included in the 4.0 release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants