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

runners: Fix crash on closing object with no stdout/stderr attributes #269

Closed
wants to merge 6 commits into from

Conversation

tohojo
Copy link
Owner

@tohojo tohojo commented Jul 3, 2022

If no file descriptors are passed between processes in the pickled objects,
the unpickled object will lead to a crash because it's missing the
stdout/stderr attributes. Make sure we set them if no FDs are passed
through the pickle/unpickle.

Hopefully fixes #268

@tohojo tohojo changed the title runners: Make sure to set stdout/stderr as None on unpickling runners: Fix crash on closing object with no stdout/stderr attributes Jul 3, 2022
If no file descriptors are passed between processes in the pickled objects,
no stdout/stderr attributes will be set on the the unpickled object, which
will lead to a crash because on close(). Fix this by checking if the
attributes exist before closing them.

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
When parsing data in the multiprocess runner, we were using an
infinite-size queue for log messages from the work threads, and only
reading from it after parsing finished. It seems this can lead to an OOM
condition which shows up as the parsing process hanging. To fix this, limit
the size of the logging queue to 10 items, and run the reading side in a
separate daemon thread so we drain in continuously.

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
@tohojo tohojo force-pushed the pickle-fix branch 2 times, most recently from 2930a77 to 24ff633 Compare July 4, 2022 13:23
To be consistent across platforms and avoid problems with threading, use
the 'spawn' multiprocessing mode when parsing output.

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
@tohojo tohojo force-pushed the pickle-fix branch 3 times, most recently from a9d91ca to e71efa4 Compare July 4, 2022 15:25
Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
…pool

Make sure we've finished all parsing before shutting down the
multiprocessing pool.

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
@tohojo
Copy link
Owner Author

tohojo commented Jul 5, 2022

Closing in favour of #270

@tohojo tohojo closed this Jul 5, 2022
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.

Problem with current flent on macosc monterey
1 participant