Skip to content

test mode (satpy_launcher -m) fails instantly with ValueError when a plugin with a timeout is used. #144

@gerritholl

Description

@gerritholl

Describe the bug

Running satpy_launcher -m ... fails instantly with ValueError

To Reproduce

satpy_launcher.py -m /tmp/test-message /opt/pytroll/pytroll_inst/config/trollflow2-viirs-direkt.yaml

The configuration files has timeouts configured. It seems attempting to set the timeout is triggering the failure.

Expected behavior

I expect trollflow2 to process the message in the test file as it would if this message were received with posttroll in normal operating mode.

Actual results

[WARNING: 2022-03-21 16:29:35 : satpy_launcher] Launching Satpy-based runner.
[INFO: 2022-03-21 16:29:35 : trollflow2.launcher] Launching trollflow2 with threads
[DEBUG: 2022-03-21 16:29:35 : trollflow2.launcher] Distributed processing not configured, using default scheduler
[ERROR: 2022-03-21 16:29:35 : trollflow2.launcher] Process crashed
Traceback (most recent call last):
  File "/opt/pytroll/pytroll_inst/mambaforge/envs/py39/lib/python3.9/site-packages/trollflow2/launcher.py", line 370, in process
    signal.signal(signal.SIGALRM, _timeout_handler)
  File "/opt/pytroll/pytroll_inst/mambaforge/envs/py39/lib/python3.9/signal.py", line 47, in signal
    handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
ValueError: signal only works in main thread of the main interpreter
[DEBUG: 2022-03-21 16:29:35 : trollflow2.launcher] Cleaning up
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/opt/pytroll/pytroll_inst/mambaforge/envs/py39/lib/python3.9/threading.py", line 973, in _bootstrap_inner
    self.run()
  File "/opt/pytroll/pytroll_inst/mambaforge/envs/py39/lib/python3.9/threading.py", line 910, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/pytroll/pytroll_inst/mambaforge/envs/py39/lib/python3.9/site-packages/trollflow2/launcher.py", line 370, in process
    signal.signal(signal.SIGALRM, _timeout_handler)
  File "/opt/pytroll/pytroll_inst/mambaforge/envs/py39/lib/python3.9/signal.py", line 47, in signal
    handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
ValueError: signal only works in main thread of the main interpreter
[INFO: 2022-03-21 16:29:35 : trollflow2.launcher] All 0 files produced nominally in 0:00:00.145675

Environment Info:

  • Trollflow2 Version: 0.13.5.dev8+gde82238
  • Satpy Version: 0.35.1.dev14+gc5ea104c

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions