2024-05-13T12:19:37.4525274Z self = <mlserver.metrics.server._NoSignalServer object at 0x7f3c72791df0>
2024-05-13T12:19:37.4526191Z
2024-05-13T12:19:37.4526423Z @contextlib.contextmanager
2024-05-13T12:19:37.4527388Z def capture_signals(self) -> Generator[None, None, None]:
2024-05-13T12:19:37.4528509Z # Signals can only be listened to from the main thread.
2024-05-13T12:19:37.4529501Z if threading.current_thread() is not threading.main_thread():
2024-05-13T12:19:37.4530392Z yield
2024-05-13T12:19:37.4531284Z return
2024-05-13T12:19:37.4532179Z # always use signal.signal, even if loop.add_signal_handler is available
2024-05-13T12:19:37.4533516Z # this allows to restore previous signal handlers later on
2024-05-13T12:19:37.4534790Z original_handlers = {sig: signal.signal(sig, self.handle_exit) for sig in HANDLED_SIGNALS}
2024-05-13T12:19:37.4535789Z try:
2024-05-13T12:19:37.4536375Z yield
2024-05-13T12:19:37.4537038Z finally:
2024-05-13T12:19:37.4537671Z for sig, handler in original_handlers.items():
2024-05-13T12:19:37.4538614Z signal.signal(sig, handler)
2024-05-13T12:19:37.4539697Z # If we did gracefully shut down due to a signal, try to
2024-05-13T12:19:37.4540844Z # trigger the expected behaviour now; multiple signals would be
2024-05-13T12:19:37.4542113Z # done LIFO, see https://stackoverflow.com/questions/48434964
2024-05-13T12:19:37.4543283Z for captured_signal in reversed(self._captured_signals):
2024-05-13T12:19:37.4544333Z > signal.raise_signal(captured_signal)
2024-05-13T12:19:37.4545407Z E TypeError: an integer is required (got type NoneType)
2024-05-13T12:19:37.4546128Z
2024-05-13T12:19:37.4546905Z .tox/mlserver/lib/python3.9/site-packages/uvicorn/server.py:328: TypeError
Reverts SeldonIO/MLServer#1648
This has temporarily broken some tests [1][2]. Will revert it and get it ready again.
[1] https://github.com/SeldonIO/MLServer/pull/1757/checks [2]