Open
Conversation
Author
|
Fixed (hopefully) the errors reported in CI. Had to use |
Author
|
Thanks for approving the pipeline. Hopefully I fixed the flaky test :) It seems that leak sanitizer doesn't work with panicking tests, so I disabled them when compiled under this sanitizer. The error that we get here might be related to a custom allocator. I'm not sure EDIT I couldn't reproduce leak sanitizer error in the Docker container with Ubuntu 24.04 and Rust nightly. Not sure why it's happening in the CI. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds process polling capabilities via
Processtype that implementsSource.pidfd.EVFILT_PROCfilter ofkqueue.To implement
ProcessI made the following changes.epoll-based andpoll-based selectors:pidfdis like any other file descriptor.kqueue-based selector and relatedis_*functions to support newEVFILT_PROCfilter and prevent code repetition.lpCompletionKey), and each selector maintains a mapping between the handles and the associated dataHandleInfo. For processes the associated data consists of user-provided token. Currently only processes are registered as handles, but everything else can be re-implemented using handles to simplify the code (e.g.Arc<CompletionPort>will no longer be needed inNamedPipeand it will be possible to register the same pipe in several selectors). Please let me know if this is something you want to be done in this PR.tests/process.rstest.tests/utilmodule to support large number of events.Besides process polling this PR includes fixes suggested by the latest Clippy version.
EDIT
The motivation behind non-blocking process polling is to simplify projects that use
mioto collect output from child processes (e.g. test harnesses, virtual networks). Currently such projects either use a separate thread to wait for child processes viawaitsyscall (that waits for any process to exit) orpollwith small timeout and check whether the processes exited after eachpoll. The former needs mutexes to synchhorinze the waiting thread with the poller, and the latter is as efficient as active polling. With proper process polling such projects would use the same thread to monitor process status, this would greatly simplify their code bases.EDIT 2
I tested the changes on Linux, MacOS, FreeBSD and Windows using the same commands as in CI and latest Rust version.