Skip to content

fix [javalib]: Process#waitFor(timeout) now handles large number of nanoseconds #3954

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

LeeTibbert
Copy link
Contributor

@LeeTibbert LeeTibbert commented Jun 10, 2024

This PR will fix #3944, even though the relationship is not face evident.
This assumes the presence of now merged PR #3950.

javalib Process#waitFor(timeout) on macOS and recent unix-like operating systems now sets the timeout data
structure it passes to the operating system correctly.

The tv_nsec nanosecond field is invalid if not between 0 and 999_999_999 (one nano short of a full second) .
Otherwise, it is the errno: 22 (EINVAL) reported in the Issue.

See Issue #3944 for more details.


This PR also corrects a previously unreported defect when the timeout argument passed to `waitFor(timeout)` is negative. JVM allows negative timeout values. Now SN on macOS and recent unix-like follow the JVM and convert negative timeouts to zero.

waitFor(timeout) on Windows did/does not have this defect.

@LeeTibbert
Copy link
Contributor Author

Reviewers,

Please see also Issue #3957. I mention this so that you can skip over the obvious defect described.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

java.lang.Process.waitFor unable to handle broken pipe
2 participants