beam-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Hulette (Jira)" <j...@apache.org>
Subject [jira] [Comment Edited] (BEAM-12501) subprocess_server.stop_process fails on Windows
Date Wed, 16 Jun 2021 16:32:00 GMT

    [ https://issues.apache.org/jira/browse/BEAM-12501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17364366#comment-17364366
] 

Brian Hulette edited comment on BEAM-12501 at 6/16/21, 4:31 PM:
----------------------------------------------------------------

subprocess_server_test.py should have a test that actually starts/stops a JavaJarServer to
exercise this. That would get executed on linux, mac, and windows in GitHub actions.

The issue is that this would add some dependencies for our unit tests:
- Java (probably not a major issue?)
- Some jar to execute, needs to start a gRPC server (more of a problem)


was (Author: bhulette):
subprocess_server_test.py should have a test that actually starts/stops a JavaJarServer to
exercise this. That would get executed on linux, mac, and windows in GitHub actions.

The issue is that this would add some dependencies for our unit tests:
- Java (probably not a major issue?)
- Some jar to execute (more of a problem)

> subprocess_server.stop_process fails on Windows
> -----------------------------------------------
>
>                 Key: BEAM-12501
>                 URL: https://issues.apache.org/jira/browse/BEAM-12501
>             Project: Beam
>          Issue Type: Bug
>          Components: cross-language, sdk-py-core
>    Affects Versions: 2.30.0
>            Reporter: Brian Hulette
>            Priority: P2
>
> subprocess_server's stop_process method uses send_signal(signal.SIGINT) which is not
a cross-platform way to terminate a process. We should probably use [terminate or kill|https://github.com/apache/beam/blob/acc0f76a2f3292276ae144f84c4130c504a334a1/sdks/python/apache_beam/transforms/external.py#L294]
here instead.
> This is callled when closing the [context|https://github.com/apache/beam/blob/acc0f76a2f3292276ae144f84c4130c504a334a1/sdks/python/apache_beam/transforms/external.py#L294]
in ExternalTransform. From [user@ bug report|https://lists.apache.org/thread.html/rd0e83292391e8d214ffca8eedae7d096b7fb463dc17971472c78c463%40%3Cuser.beam.apache.org%3E]
> {code}
> Traceback (most recent call last):
>   File "beam-sql.py", line 18, in <module>
>     |'sql print' >> beam.Map(print)
>   File "C:\Users\XXX\Documents\8-Git\apache_beam\venv\lib\site-packages\apache_beam\pvalue.py",
line 142, in __or__
>     return self.pipeline.apply(ptransform, self)
>   File "C:\Users\XXX\Documents\8-Git\apache_beam\venv\lib\site-packages\apache_beam\pipeline.py",
line 641, in apply
>     transform.transform, pvalueish, label or transform.label)
>   File "C:\Users\XXX\Documents\8-Git\apache_beam\venv\lib\site-packages\apache_beam\pipeline.py",
line 651, in apply
>     return self.apply(transform, pvalueish)
>   File "C:\Users\XXX\Documents\8-Git\apache_beam\venv\lib\site-packages\apache_beam\pipeline.py",
line 694, in apply
>     pvalueish_result = self.runner.apply(transform, pvalueish, self._options)
>   File "C:\Users\XXX\Documents\8-Git\apache_beam\venv\lib\site-packages\apache_beam\runners\runner.py",
line 188, in apply
>     return m(transform, input, options)
>   File "C:\Users\XXX\Documents\8-Git\apache_beam\venv\lib\site-packages\apache_beam\runners\runner.py",
line 218, in apply_PTransform
>     return transform.expand(input)
>   File "C:\Users\XXX\Documents\8-Git\apache_beam\venv\lib\site-packages\apache_beam\transforms\external.py",
line 304, in expand
>     pipeline.local_tempdir)
>   File "c:\users\XXX\appdata\local\programs\python\python37\lib\contextlib.py", line
119, in __exit__
>     next(self.gen)
>   File "C:\Users\XXX\Documents\8-Git\apache_beam\venv\lib\site-packages\apache_beam\transforms\external.py",
line 351, in _service
>     yield stub
>   File "C:\Users\XXX\Documents\8-Git\apache_beam\venv\lib\site-packages\apache_beam\transforms\external.py",
line 503, in __exit__
>     self._service_provider.__exit__(*args)
>   File "C:\Users\XXX\Documents\8-Git\apache_beam\venv\lib\site-packages\apache_beam\utils\subprocess_server.py",
line 72, in __exit__
>     self.stop()
>   File "C:\Users\XXX\Documents\8-Git\apache_beam\venv\lib\site-packages\apache_beam\utils\subprocess_server.py",
line 131, in stop
>     self.stop_process()
>   File "C:\Users\XXX\Documents\8-Git\apache_beam\venv\lib\site-packages\apache_beam\utils\subprocess_server.py",
line 181, in stop_process
>     return super(JavaJarServer, self).stop_process()
>   File "C:\Users\XXX\Documents\8-Git\apache_beam\venv\lib\site-packages\apache_beam\utils\subprocess_server.py",
line 141, in stop_process
>     self._process.send_signal(signal.SIGINT)
>   File "c:\users\XXX\appdata\local\programs\python\python37\lib\subprocess.py", line
1306, in send_signal
>     raise ValueError("Unsupported signal: {}".format(sig))
> ValueError: Unsupported signal: 2
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message