Skip to content

common/admin_socket: use POSIX timer for delayed signal delivery - #68816

Merged
batrick merged 1 commit into
ceph:mainfrom
tchaikov:wip-delayed-signal
May 19, 2026
Merged

batrick merged 1 commit into
ceph:mainfrom
tchaikov:wip-delayed-signal

Conversation

@tchaikov

@tchaikov tchaikov commented May 8, 2026 •

Copy link
Copy Markdown
Contributor

AdminSocketRaise.AsyncReschedule was flaking on arm64:

  [ RUN      ] AdminSocketRaise.AsyncReschedule
  /ceph/src/test/admin_socket.cc:497: Failure
  Expected equality of these values:
    0
    sig2.count.load()
      Which is: 1
  [  FAILED  ] AdminSocketRaise.AsyncReschedule (1045 ms)

The old approach forked a child that polled the clock and called kill() at the deadline. The problem is: the deadline was computed before fork(), so any fork latency ate directly into the timing budget. On a busy arm64 host that 50 ms margin just wasn't enough.

The fix is to let the kernel own the timer via timer_create(). No child process, no polling, no fork overhead, and SIGCONT still works.

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

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@github-actions github-actions Bot added the common label May 8, 2026
@tchaikov
tchaikov force-pushed the wip-delayed-signal branch from 271dfc1 to 9e87b40 Compare May 8, 2026 08:47
@tchaikov

tchaikov commented May 8, 2026

Copy link
Copy Markdown
Contributor Author

see https://jenkins.ceph.com/job/ceph-pull-requests-arm64/92666/consoleFull#784931986e840cee4-f4a4-4183-81dd-42855615f2c1 for an instance of the test failure:

[ RUN      ] AdminSocketRaise.Async
[       OK ] AdminSocketRaise.Async (582 ms)
[ RUN      ] AdminSocketRaise.AsyncReschedule
/ceph/src/test/admin_socket.cc:497: Failure
Expected equality of these values:
  0
  sig2.count.load()
    Which is: 1

[  FAILED  ] AdminSocketRaise.AsyncReschedule (1045 ms)

@tchaikov

tchaikov commented May 8, 2026

Copy link
Copy Markdown
Contributor Author

@batrick could you help review this change? as you reviewed the original pull request at #53689, i am wondering if you are also interested in reviewing this one =)

AdminSocketRaise.AsyncReschedule was flaking on arm64:

  [ RUN      ] AdminSocketRaise.AsyncReschedule
  /ceph/src/test/admin_socket.cc:497: Failure
  Expected equality of these values:
    0
    sig2.count.load()
      Which is: 1
  [  FAILED  ] AdminSocketRaise.AsyncReschedule (1045 ms)

The old approach forked a child that polled the clock and called
kill() at the deadline.  The problem is: the deadline was computed
before fork(), so any fork latency ate directly into the timing
budget.  On a busy arm64 host that 50 ms margin just wasn't enough.

The fix is to let the kernel own the timer via timer_create(). No
child process, no polling, no fork overhead, and SIGCONT still works.

Signed-off-by: Kefu Chai <[email protected]>
@tchaikov
tchaikov force-pushed the wip-delayed-signal branch from 9e87b40 to d97b7cc Compare May 8, 2026 11:32

@batrick batrick left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Much better, thanks!

@vshankar vshankar 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.

Nicely done!

@NitzanMordhai

Copy link
Copy Markdown
Contributor

@batrick
batrick merged commit 5a9a55c into ceph:main May 19, 2026
6 checks passed
@tchaikov
tchaikov deleted the wip-delayed-signal branch May 20, 2026 01:13
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.

5 participants