Leonard Volarić Horvat
12/12/2024, 9:04 AM3.8.18) process which starts several Hamilton (1.84.0) DAGs, each in one subprocess (multiprocessing.Process). I want to be able to terminate all of them when an event (a stop request) happens in the master process.
I have added a SIGTERM handler in the subprocesses, and I am using Process.terminate() from the master process to actually send the signal. The handler does some cleanup, and then issues a sys.exit(signum).
The handler seems to be triggered correctly, and the exit is triggered as well, but something (apparently related to caching, which I do use) breaks, and the subprocesses end up in a sleeping state (S in htop) and somehow do not terminate. The error is this:
sys.exit(signum)
SystemExit: 15
During handling of the above exception, another exception occurred:
...
File "/my/venv/lib/python3.8/site-packages/hamilton/caching/adapter.py", line 1424, in post_node_execute
assert data_version is not SENTINEL
Process.kill() works just fine, but I would rather not go for the nuclear option if I can help it 😅
How can I abort a Hamilton DAG execution more-or-less cleanly?Elijah Ben Izzy
12/12/2024, 5:17 PMLeonard Volarić Horvat
12/13/2024, 9:13 AMElijah Ben Izzy
12/13/2024, 7:24 PM