Skip to content

fix: Destroy network communication channels used in replication on shutdown#4005

Merged
as51340 merged 4 commits intomasterfrom
fix/long-waiting-on-shutdown
Apr 9, 2026
Merged

fix: Destroy network communication channels used in replication on shutdown#4005
as51340 merged 4 commits intomasterfrom
fix/long-waiting-on-shutdown

Conversation

@as51340
Copy link
Copy Markdown
Contributor

@as51340 as51340 commented Apr 6, 2026

Abort socket before closing thread pool and destroying client in order to unblock the shutdown. Also, take read lock on shutdown to allow concurrent shutdown with replication.

@as51340 as51340 self-assigned this Apr 6, 2026
@as51340 as51340 added bug bug Docs - changelog only Docs - changelog only CI -build=community -test=core Run community build and core tests on push CI -build=coverage -test=core Run coverage build and core tests on push CI -build=jepsen -test=core Run jepsen build and core tests on push CI -build=debug -test=core Run debug build and core tests on push CI -build=debug -test=integration Run debug build and integration tests on push CI -build=release -test=core Run release build and core tests on push CI -build=release -test=e2e Run release build and e2e tests on push CI -build=coverage -test=clang_tidy labels Apr 6, 2026
@as51340 as51340 added this to the mg-v3.10.0 milestone Apr 6, 2026
@as51340 as51340 requested review from colinbarry April 8, 2026 14:22
@as51340 as51340 marked this pull request as ready for review April 8, 2026 14:22
@as51340 as51340 added jepsen Bugs found by Jepsen tests Capability - high-availability labels Apr 8, 2026
Copy link
Copy Markdown
Contributor

@colinbarry colinbarry left a comment

Choose a reason for hiding this comment

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

Approved, with note about perhaps documenting the constness of these functions.

Comment thread src/memgraph.cpp
@as51340 as51340 removed CI -build=community -test=core Run community build and core tests on push CI -build=coverage -test=core Run coverage build and core tests on push CI -build=jepsen -test=core Run jepsen build and core tests on push CI -build=debug -test=core Run debug build and core tests on push CI -build=debug -test=integration Run debug build and integration tests on push CI -build=release -test=core Run release build and core tests on push CI -build=release -test=e2e Run release build and e2e tests on push CI -build=coverage -test=clang_tidy labels Apr 9, 2026
@as51340 as51340 changed the title fix: Long shutdown on main fix: Destroy network communication channels used in replication on shutdown Apr 9, 2026
@as51340 as51340 added this pull request to the merge queue Apr 9, 2026
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 9, 2026

Merged via the queue into master with commit 5a438dd Apr 9, 2026
41 checks passed
@as51340 as51340 deleted the fix/long-waiting-on-shutdown branch April 9, 2026 11:06
@as51340
Copy link
Copy Markdown
Contributor Author

as51340 commented Apr 17, 2026

Tracking

  • [Link to Epic/Issue]

Standard development

CI Testing Labels

  • Select the appropriate CI test labels (CI -build=build-name -test=test-suite)

Documentation checklist

  • Add the documentation label
  • Add the bug / feature label
  • Add the milestone for which this feature is intended
    • If not known, set for a later milestone
  • Write a release note, including added/changed clauses
    • This PR fixes the possible deadlock that could've occurred on shutdown for ASYNC replicas by aborting ongoing ASYNC replication task before closing the thread pool and replication client. Also, on shutdown, main thread will not wait anymore for main to finish the replication to replicas because that could take a really long time if for example snapshot is being transferred. #4005
    • What has changed? What does it mean for a user? What should a user do with it? [#{{PR_number}}]({{link to the PR}})
  • [ Documentation PR link memgraph/documentation#XXXX ]
    • Is back linked to this development PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug bug Capability - high-availability Docs - changelog only Docs - changelog only jepsen Bugs found by Jepsen tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants