Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reactor: Always retry waitpid #152

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

michael-redpanda
Copy link

A possible issue with how Docker Desktop v4.34+ (particulary on macOS) handles pidfd functionality causes an assertion failure in Seastar's reactor::waitpid method.

The issue:

  • Seastar creates a pidfd using pidfd_open
  • It polls this file descriptor until it becomes readable
  • When readable, call waitpid with WNOHANG. According to pidfd_open, the file descriptor becomes readable when the process terminates
  • Seastar expects waitpid to either return a positive integer representing the child process that has ended or a negative value to indicate an error. However if waitpid returns 0, then Seastar asserts, crashing the using application.

This change introduces retry logic when using a pidfd and removes the assertion.

A possible issue with how Docker Desktop v4.34+ (particulary on macOS)
handles `pidfd` functionality causes an assertion failure in Seastar's
`reactor::waitpid` method.

The issue:

- Seastar creates a `pidfd` using `pidfd_open`
- It polls this file descriptor until it becomes readable
- When readable, call `waitpid` with `WNOHANG`.  According to
  [pidfd_open](https://man7.org/linux/man-pages/man2/pidfd_open.2.html),
  the file descriptor becomes readable when the process terminates
- Seastar expects `waitpid` to either return a positive integer
  representing the child process that has ended or a negative value to
  indicate an error.  However if `waitpid` returns `0`, then Seastar
  asserts, crashing the using application.

This change introduces retry logic when using a `pidfd` and removes the
assertion.

Signed-off-by: Michael Boquard <[email protected]>
@michael-redpanda michael-redpanda requested a review from a team November 8, 2024 16:45
@michael-redpanda michael-redpanda self-assigned this Nov 8, 2024
@michael-redpanda michael-redpanda requested review from pgellert, BenPope, oleiman, IoannisRP and StephanDollberg and removed request for a team November 8, 2024 16:45
@StephanDollberg
Copy link
Member

A possible issue with how Docker Desktop v4.34+ (particulary on macOS)

Which kernel version is this using under the hood?

@michael-redpanda
Copy link
Author

michael-redpanda commented Nov 8, 2024

A possible issue with how Docker Desktop v4.34+ (particulary on macOS)

Which kernel version is this using under the hood?

@StephanDollberg

❯ docker exec -it test-debug-bundle-redpanda-1 uname -a
Linux f73147b300b5 6.10.11-linuxkit #1 SMP Thu Oct  3 10:17:28 UTC 2024 aarch64 GNU/Linux

Copy link
Member

@BenPope BenPope left a comment

Choose a reason for hiding this comment

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

LGTM

@michael-redpanda michael-redpanda merged commit 2380681 into v24.3.x Nov 11, 2024
0 of 14 checks passed
@michael-redpanda
Copy link
Author

Upstream merged: scylladb#2531

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants