-
Notifications
You must be signed in to change notification settings - Fork 4
fix: Multiprocessing deadlock #357
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #357 +/- ##
==========================================
- Coverage 76.35% 70.66% -5.69%
==========================================
Files 29 29
Lines 3345 3348 +3
Branches 525 525
==========================================
- Hits 2554 2366 -188
- Misses 558 761 +203
+ Partials 233 221 -12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|
||
| docker system prune --force | ||
|
|
||
| tesseract run reproducer apply '{"inputs":{}}' --output-path outputs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we're going to commit this example let's name it something more specific, like process-pool-executor-reproducer
|
I dug into how we are doing this log redirect and the calling thread executes here - the LogPipe thread is executed within an This is why in LogPipe we do strange things - start and join the thread within the but still, why a thread if we block on Regardless, without restructuring the LogPipe class, I think the solution here is fine and I'm able to test it succefully. I recommend adding a warning to the join timeout because we are effectively telling it to stop running the LogPipe thread's |
josiahbjorgaard
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, suggest a warning and a question.
Curious if you think refactoring logpipe to not be threaded would be cleaner code and same functionality?
| # Use a timeout so something weird happening in the logging thread doesn't | ||
| # cause this to hang indefinitely | ||
| # | ||
| # FIXME: this always times out in the multiprocessing case? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this with timeout=1, 10, and no timeout and the reproducer had no error, but this timeout is going to vary depending on the time it takes run to execute.
Should we add a warning here so that we can revise the timeout later if we frequently find an issue with the timeout, or set it to something even longer?
if self.is_alive():
warn.warning("LogPipe thread timed out while executing.")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the FIXME, it works for me?
CLA signatures requiredThank you for your PR, we really appreciate it! Like many open-source projects, we ask that all contributors sign our Contributor License Agreement before we can accept your contribution. This only needs to be done once per contributor. You can do so by commenting the following on this pull request: @PasteurBot I have read the CLA Document and I hereby sign the CLA 1 out of 2 committers have signed the CLA. |
|
superseded by #392 |
Relevant issue or PR
#356
Description of changes
threading.Locktotesseract_core.runtime.logs.LogPipethreading.Locktotesseract_core.sdk.logs.LogPipeapplyendpoint as picklable as possibleTesting done