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 adds reactor::do_waitpid which loops on calling waitpid until it returns a non-zero value. This method is called both when a pidfd is in use and when it isn't. The assertion is also removed.
A possible issue with how Docker Desktop v4.34+ (particulary on macOS) handles
pidfd
functionality causes an assertion failure in Seastar'sreactor::waitpid
method.The issue:
pidfd
usingpidfd_open
waitpid
withWNOHANG
. According to pidfd_open, the file descriptor becomes readable when the process terminateswaitpid
to either return a positive integer representing the child process that has ended or a negative value to indicate an error. However ifwaitpid
returns0
, then Seastar asserts, crashing the using application.This change adds
reactor::do_waitpid
which loops on callingwaitpid
until it returns a non-zero value. This method is called both when apidfd
is in use and when it isn't. The assertion is also removed.