Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-12501

subprocess_server.stop_process fails on Windows

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: P2
    • Resolution: Unresolved
    • Affects Version/s: 2.30.0
    • Fix Version/s: None
    • Component/s: cross-language, sdk-py-core
    • Labels:
      None

      Description

      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 here instead.

      This is callled when closing the context in ExternalTransform. From user@ bug report

      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
      

        Attachments

          Activity

            People

            • Assignee:
              chamikara Chamikara Madhusanka Jayalath
              Reporter:
              bhulette Brian Hulette
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: