VowpalWabbit / py-vowpal-wabbit-next

Experimental new Python bindings for the VowpalWabbit library
https://vowpal-wabbit-next.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
12 stars 5 forks source link

`run_cli_driver` ignores SIGINT #77

Open mwydmuch opened 1 year ago

mwydmuch commented 1 year ago

As in the title, run_cli_driver method ignores SIGINT send to the python script and waits till the end of the run. This is probably also the case for other methods, but this one usually takes a lot of time.

Example:

  1. Run the script from https://github.com/VowpalWabbit/vowpal_wabbit/issues/4510#issuecomment-1488566045
  2. Press Ctrl+C/Cmd+C after a few seconds
  3. The script will finish the run of cli driver before interrupting.
jackgerrits commented 1 year ago

I opened #78 to partially address this issue, however, it is currently only able to early exit when the next pass completes. The early exit logic in VW is centered around passes which is the reason for this limitation. I opened a feature request in VW (VowpalWabbit/vowpal_wabbit#4540) to properly handle early exit for the middle of a pass, which could have nice side effects of handling SIGINT in a better way in the core tool too.