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

Add try-except for process.send_signal so it can work on Windows. #31574

Merged
merged 1 commit into from
Jun 12, 2024

Conversation

jamesroseman
Copy link
Contributor

The current subprocess_server uses process.send_signal to terminate the process. On Windows, this will raise a ValueError, as .terminate() should be used instead.

Please add a meaningful description for your change here

This would close #21069


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

The current subprocess_server uses process.send_signal to terminate the process. On Windows, this will raise a ValueError, as .terminate() should be used instead.
Copy link
Contributor

Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:

R: @shunping for label python.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

Copy link
Contributor

@shunping shunping left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks.

Copy link
Contributor

R: @tvalentyn for final approval

Copy link
Contributor

@tvalentyn tvalentyn left a comment

Choose a reason for hiding this comment

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

Thanks!
Curious, in which scenario are you using Beam + Windows?

@tvalentyn tvalentyn merged commit 0bf4307 into apache:master Jun 12, 2024
79 checks passed
@jamesroseman
Copy link
Contributor Author

Thanks! Curious, in which scenario are you using Beam + Windows?

Doing some prototyping at work where we're stuck on Windows machines (even though we deploy on Linux boxes). We also aren't allowed access to Docker on dev boxes which is another hurdle for using Beam...

@victorrgez
Copy link

We use it for debugging code in Local with DirectRunner before uploading changes to Dataflow. Because of this issue we had some problems and could not use in Local some Java cross-language transforms

Thanks! Curious, in which scenario are you using Beam + Windows?

@the-xentropy
Copy link

I think this patch regressed at some point. The stop code now is a raw SIGINT with no try-except block.

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.

subprocess_server.stop_process fails on Windows
5 participants