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

Avoid hanging by using non-blocking pipe #52

Merged
merged 3 commits into from
Jul 12, 2022

Conversation

paulromano
Copy link
Contributor

Some of have observed that WATTS will sometimes hang when writing output (#49). This PR should fix this by using a non-blocking pipe. However, this solution (and in fact our prior code) only works on Unix-based platforms. On Windows, we now revert to using normal subprocess.run instead of our special version. This means that, unfortunately, if you're on Windows, using the show_stdout and show_stderr arguments won't work (they rely on tee_stdout and tee_stderr which in turn implicitly rely on our implementation of run).

I don't have WATTS installed anywhere on a Windows environment so I'm hoping someone can check whether this actually works there (@samgdotson?).

Copy link
Contributor

@samgdotson samgdotson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking the time to look into this!
watts appears successful on Windows with these updates. At the moment there are issues within ABCE itself that are preventing a complete run, but the current issue is resolved. If the non-blocking pipe solution still works on UNIX (can this be confirmed, perhaps @nstauff?), then I would approve (however, I do not have write access so further approval is still necessary).

Also of concern is that the nonblocking-pipe solution created a significant slowdown when run on WSL2. Is there a time difference between the original code and this PR?

@paulromano
Copy link
Contributor Author

@samgdotson Thanks for confirming that it works on Windows. Does the slowdown you're seeing on WSL2 happen regardless of whether show_stdout is set to true or not?

@paulromano
Copy link
Contributor Author

@samgdotson To follow up on your question at your meeting today: on Linux, I do not find any observable slowdown from using the output capturing here compared to just running an application directly.

@nstauff
Copy link
Contributor

nstauff commented Jul 11, 2022

@paulromano @samgdotson - I tested the PyARC plugin on my MAC and it works fine. Thanks!

@samgdotson
Copy link
Contributor

@nstauff could you merge this PR? I do not have write access.

@nstauff nstauff merged commit a9f07c8 into watts-dev:development Jul 12, 2022
@paulromano paulromano deleted the nonblocking-pipe branch July 12, 2022 18:20
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.

3 participants