{{ message }}
Repository navigation
Conversation
Fix URMA polling shutdown lifetime
Contributor
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
4 open issues
new urma::UrmaResource;performs default-initialization, which leaves POD/aggregate members… · New The return value ofatexit(...)is ignored. If registration fails (non-zero), the process will… · New These tests directly depend onUrmaEndpointinternal state (PollerGroups(),… · New These tests directly depend onUrmaEndpointinternal state (PollerGroups(),… · New
What changed in this PR
Fixes URMA polling worker shutdown ordering at process exit to prevent late endpoint/CQ cleanup from enqueueing operations into already-destroyed poller queues.
Changes:
- Keep poller-group storage alive for process lifetime via a leaky singleton accessor.
- Add an
atexithandler that stops/joins URMA pollers without releasing the URMA IOBuf pool. - Add unit/death tests covering repeated release, late CQ ops after stop, and exit ordering.
Review effort: Lite
Comment on lines
+191
to
+193
| g_exit_endpoint = new urma::UrmaEndpoint(nullptr); | ||
| g_exit_endpoint->_resource = new urma::UrmaResource; | ||
| g_exit_endpoint->_cq_sid = 7; |
Comment on lines
+630
to
+632
| if (FLAGS_urma_use_polling) { | ||
| atexit(ReleasePollingModeAtExit); | ||
| } |
Comment on lines
+78
to
+82
| auto& group = urma::UrmaEndpoint::PollerGroups()[0]; | ||
| EXPECT_FALSE(group.running.load()); | ||
| for (const auto& poller : group.pollers) { | ||
| EXPECT_EQ(INVALID_BTHREAD, poller.tid); | ||
| } |
Copilot stopped reviewing on behalf of
wwbmmm due to an error
October 21, 2026 04:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What problem does this PR solve?
Issue Number: Related to #3428
Problem Summary:
The normal process-exit path lacks a dedicated stop-and-join handler for URMA
polling workers, while poller groups are stored in an ordinary static vector.
Late Socket/UrmaEndpoint cleanup may enqueue CQ removal operations after the
poller queues have been destroyed.
What is changed and the side effects?
Changed:
Validation (URMA mock):
WITH_URMA=ONandURMA_USE_MOCK=ON.git diff --checkpassed.Side effects:
Performance effects: adds a running-state check to CQ registration/removal; the CQ polling loop is unchanged.
Breaking backward compatibility: no wire protocol or existing function signature changes. The poller-group container is intentionally retained until process termination.
Check List: