Skip to content

msg: drain stack before stopping processors to avoid shutdown hang - #63261

Merged
SrinivasaBharath merged 1 commit into
ceph:mainfrom
NitzanMordhai:wip-nitzan-msg-shutdown-hang-drain
Jul 20, 2025
Merged

SrinivasaBharath merged 1 commit into
ceph:mainfrom
NitzanMordhai:wip-nitzan-msg-shutdown-hang-drain

Conversation

@NitzanMordhai

@NitzanMordhai NitzanMordhai commented May 13, 2025 •

Copy link
Copy Markdown
Contributor

AsyncMessenger::shutdown() called WorkerProcessor::stop() first, killing the worker threads, then queued a C_drain callback via stack->drain(). If a worker had already exited its event loop it never processed the callback, so drain.wait() blocked forever and the monitor shutdown hung for minutes.

Move stack->drain() ahead of the processors->stop() loop. With the new order the workers are still alive to acknowledge the drain.

Fixes: https://tracker.ceph.com/issues/

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

@NitzanMordhai
NitzanMordhai requested a review from rzarzynski May 13, 2025 07:48
@NitzanMordhai
NitzanMordhai requested a review from a team as a code owner May 13, 2025 07:48
@github-actions github-actions Bot added the core label May 13, 2025
@NitzanMordhai

Copy link
Copy Markdown
Contributor Author

@NitzanMordhai
NitzanMordhai force-pushed the wip-nitzan-msg-shutdown-hang-drain branch from 5985a29 to a9ca654 Compare May 13, 2025 07:50
`AsyncMessenger::shutdown()` called WorkerProcessor::stop() first,
killing the worker threads, then queued a C_drain callback via
stack->drain().  If a worker had already exited its event loop it never
processed the callback, so drain.wait() blocked forever and the monitor
shutdown hung for minutes.

Move stack->drain() ahead of the processors->stop() loop.  With the new
order the workers are still alive to acknowledge the drain.

Fixes: https://tracker.ceph.com/issues/71303
Signed-off-by: Nitzan Mordechai <[email protected]>
@NitzanMordhai
NitzanMordhai force-pushed the wip-nitzan-msg-shutdown-hang-drain branch from a9ca654 to 5fbb9c5 Compare May 13, 2025 07:53
@ljflores

Copy link
Copy Markdown
Member

Apologies for the delay in QA- I ran into some issues that I think are related to another PR. I'm asking Bharath to drop it and rerun some jobs to make sure.

Testing ref: https://tracker.ceph.com/issues/71409

@amathuria

Copy link
Copy Markdown
Contributor

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants