Commit 14106f9
authored
Disable SIGINT handling on GAE crons for metric collection (#4586)
This solves the following error:
```
signal only works in main thread of the main interpreter
Traceback (most recent call last):
File "/srv/handlers/base_handler.py", line 278, in dispatch_request
return super().dispatch_request(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/layers/google.python.pip/pip/lib/python3.11/site-packages/flask/views.py", line 188, in dispatch_request
return current_app.ensure_sync(meth)(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/srv/libs/handler.py", line 100, in wrapper
with monitor.wrap_with_monitoring():
File "/layers/google.python.runtime/python/lib/python3.11/contextlib.py", line 137, in __enter__
return next(self.gen)
^^^^^^^^^^^^^^
File "/srv/clusterfuzz/_internal/metrics/monitor.py", line 148, in wrap_with_monitoring
signal.signal(signal.SIGTERM, handle_sigterm)
File "/layers/google.python.runtime/python/lib/python3.11/signal.py", line 58, in signal
handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: signal only works in main thread of the main interpreter
```1 parent 738e024 commit 14106f9
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
149 | 152 | | |
150 | 153 | | |
151 | 154 | | |
| |||
0 commit comments