-
Notifications
You must be signed in to change notification settings - Fork 75
fixes bug where process isn't completed by the time the process gets read #675
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -6,6 +6,7 @@ | |||||||||||||
| import logging | ||||||||||||||
| import os | ||||||||||||||
| import subprocess | ||||||||||||||
| import sys | ||||||||||||||
| import time | ||||||||||||||
| import warnings | ||||||||||||||
|
|
||||||||||||||
|
|
@@ -645,11 +646,17 @@ | |||||||||||||
| if "process" not in locals() or process is None: | ||||||||||||||
| return | ||||||||||||||
|
|
||||||||||||||
| failure = process.poll() != 0 | ||||||||||||||
| # wait for the process to exit so we can properly read the exit code | ||||||||||||||
| process.wait(timeout=60) | ||||||||||||||
| process_code = process.poll() | ||||||||||||||
| failure = process_code != 0 | ||||||||||||||
|
|
||||||||||||||
| if not failure: | ||||||||||||||
| logger.info("Operation completed successfully! 🎉") | ||||||||||||||
| else: | ||||||||||||||
| logger.error("Training subprocess has not exited yet. Sending SIGTERM.") | ||||||||||||||
| logger.error( | ||||||||||||||
| f"Training subprocess has not exited yet. Sending SIGTERM. Process code: {process_code}" | ||||||||||||||
| ) | ||||||||||||||
|
Comment on lines
+657
to
+659
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Misleading error message. This branch is taken when 🔎 Proposed fix else:
logger.error(
- f"Training subprocess has not exited yet. Sending SIGTERM. Process code: {process_code}"
+ f"Training subprocess exited with non-zero code: {process_code}"
)Note: After fixing this, you may also want to reconsider whether calling 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
|
|
||||||||||||||
| process.terminate() | ||||||||||||||
| try: | ||||||||||||||
|
|
||||||||||||||
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.
Missing exception handling for
subprocess.TimeoutExpired.process.wait(timeout=60)raisessubprocess.TimeoutExpiredif the process doesn't exit within the timeout. When this exception is raised, lines 651-652 are skipped, leavingfailure = False. This could mask a real failure since the function might complete without raisingRuntimeErrorat line 674.🔎 Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents