-
Notifications
You must be signed in to change notification settings - Fork 910
fix: prevent SU2_PY runner stderr deadlock and improve error handling #2653
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
Open
shbhmexe
wants to merge
6
commits into
su2code:develop
Choose a base branch
from
shbhmexe:bugfix/su2py-run-command-stderr-deadlock
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
fix: prevent SU2_PY runner stderr deadlock and improve error handling #2653
shbhmexe
wants to merge
6
commits into
su2code:develop
from
shbhmexe:bugfix/su2py-run-command-stderr-deadlock
+11
−2
Conversation
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
… copies
- SU2_PY: use subprocess.communicate() to reliably drain stderr while keeping stdout streamed,
avoiding potential hangs when stderr output is large.
- SU2_PY: fix incorrect path reporting in error messages (abspath(".") instead of abspath(",")).
- C++ entrypoints: guard/limit copies into fixed-size config filename buffers to prevent
potential overflow on long paths.
Signed-off-by: shbhmexe <shubhushukla586@gmail.com>
Signed-off-by: shbhmexe <shubhushukla586@gmail.com>
pcarruscag
reviewed
Dec 22, 2025
Keeping only Python fixes:
- stderr deadlock prevention via subprocess.communicate()
- path reporting bug fix (abspath('.') not abspath(','))
Reverted strcpy strncpy changes from SU2_CFD, SU2_DEF, SU2_DOT,
SU2_GEO, and SU2_SOL per reviewer's earlier feedback to keep it simple.
Signed-off-by: shbhmexe <shubhushukla586@gmail.com>
Author
|
Hey @pcarruscag, |
pcarruscag
reviewed
Dec 23, 2025
pcarruscag
approved these changes
Dec 23, 2025
Member
|
Update the title and description please |
Author
Hi @pcarruscag , Updated the title and description. Thanks for the review! |
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.
Proposed Changes
This PR fixes reliability issues in the SU2 Python runner (SU2_PY/SU2/run/interface.py):
Stderr deadlock prevention - Use
subprocess.communicate()to drain stderr while streaming stdout, avoiding potential hangs when SU2 processes write heavily to stderr.Improved environment variable handling - Added explicit error message when
SU2_RUNenvironment variable is not set.Path reporting fix - Fixed typo in error messages (
abspath(".")instead ofabspath(",")) to show correct working directory.Reasoning
SU2_RUNnow gives a clear error message instead of a confusingKeyError.Impact
Verification
python -m compileall -q SU2_PY✅PR Checklist