Skip to content

memory lock issues causing hangs during connection shutdown - #61021

Merged
yuriw merged 2 commits into
ceph:mainfrom
NitzanMordhai:wip-nitzan-leak-some-memory-locks-hungs
Feb 6, 2025
Merged

yuriw merged 2 commits into
ceph:mainfrom
NitzanMordhai:wip-nitzan-leak-some-memory-locks-hungs

Conversation

@NitzanMordhai

@NitzanMordhai NitzanMordhai commented Dec 10, 2024 •

Copy link
Copy Markdown
Contributor

teuthology PR that related: ceph/teuthology#2014

This PR addresses two issues:

  1. The 'stop-daemon-timeout' parameter in the YAML file can now be used to configure the stop function timeout. This resolves timeout failures observed when running monitors under Valgrind.
  2. Fixed a race condition during connection shutdown by ensuring messages are processed within the appropriate locking scope. This prevents hangs caused by improper lock handling during shutdown.

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

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
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows
  • jenkins test rook e2e

@NitzanMordhai
NitzanMordhai requested a review from a team as a code owner December 10, 2024 13:47
@NitzanMordhai NitzanMordhai changed the title leak some memory locks hungs memory lock issues causing hangs during connection shutdown Dec 11, 2024
@ljflores

Copy link
Copy Markdown
Member

jenkins test make check

increase the timeout before stop command failed. in case
of monitor running under valgrind, we sometimes failed beacuse
of timeout.

Fixes: https://tracker.ceph.com/issues/63501
Signed-off-by: Nitzan Mordechai <[email protected]>
…ctions

when shutting down monitors and valgrind is involved, we can,
sometimes, to hit race condition and locks that causing the shutdown
process to hang for a long time.

reset_recv_state - issuing a message without proper locks that
causing the shutdown to hang during shutdown connection (drain network)

Fixes: https://tracker.ceph.com/issues/63501
Signed-off-by: Nitzan Mordechai <[email protected]>
@NitzanMordhai
NitzanMordhai force-pushed the wip-nitzan-leak-some-memory-locks-hungs branch from 75d65fb to b800149 Compare December 15, 2024 11:09
@NitzanMordhai

Copy link
Copy Markdown
Contributor Author

@ljflores i fixed the typo and also added missing ceph.py change

@rzarzynski rzarzynski left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The teuthology's part must be merged first!

// Possibly unnecessary. See the comment in `deactivate_existing`.
std::lock_guard<std::mutex> l(connection->lock);
std::lock_guard<std::mutex> wl(connection->write_lock);
ldout(cct, 5) << "reset_recv_state (warped) reseting crypto and compression handlers"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah, the dout's prefix generator accesses a bunch of things without any synchronization.

@ljflores ljflores added the DNM label Dec 16, 2024
@ljflores

Copy link
Copy Markdown
Member

Added DNM so teuth PR merges first.

@rzarzynski

Copy link
Copy Markdown
Contributor

jenkins test make check

@NitzanMordhai

Copy link
Copy Markdown
Contributor Author

still waiting for ceph/teuthology#2014

@rzarzynski

Copy link
Copy Markdown
Contributor

The teuthology part is merged! Taking the DNM out!

@ljflores

ljflores commented Feb 6, 2025

Copy link
Copy Markdown
Member

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.

4 participants