Skip to content

Conversation

@nezgrath
Copy link
Collaborator

@nezgrath nezgrath commented Nov 19, 2025

Description

This pull request refines the logic for disabling vfork and posix_spawn in subprocess management within the PrepareSubprocess class. The changes improve platform checks, ensure safe attribute handling, and prevent unnecessary modifications on unsupported platforms.

Improvements to subprocess management logic:

  • The logic now correctly checks platform compatibility and only disables vfork and posix_spawn when appropriate, preventing changes on unsupported platforms.
  • Added safe attribute checks using hasattr before modifying subprocess._USE_VFORK and subprocess._USE_POSIX_SPAWN, reducing the risk of errors if these attributes are missing.
  • Original values of subprocess._USE_VFORK and subprocess._USE_POSIX_SPAWN are now stored and only restored if they were previously set, ensuring proper cleanup.

Checklist

  • I have tested these changes locally.
  • I have added unit tests (if appropriate).
  • I have added necessary documentation or updated existing documentation.
  • I have linked the issue(s) addressed by this PR if any.

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 81.81818% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.11%. Comparing base (cd04de2) to head (7512448).

Files with missing lines Patch % Lines
src/ansys/hps/data_transfer/client/binary.py 81.81% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #312      +/-   ##
==========================================
- Coverage   85.17%   85.11%   -0.06%     
==========================================
  Files          17       17              
  Lines        1551     1559       +8     
==========================================
+ Hits         1321     1327       +6     
- Misses        230      232       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nezgrath nezgrath marked this pull request as ready for review November 19, 2025 13:12
@nezgrath nezgrath merged commit cbc25bc into main Nov 19, 2025
18 checks passed
@nezgrath nezgrath deleted the mpawlik/prevent_use_vfork_failure branch November 19, 2025 13:12
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.

4 participants