Open mrticker opened 5 months ago
Hey! What does modal --version
and python -V
show for you?
>modal --version
modal client version: 0.56.4649
>python -V
Python 3.9.15
updated modal through pip:
>modal --version
modal client version: 0.56.4763
The issue is still there.
@freider are you able to check if this is a still a problem on Windows with the current modal
client version?
Checked - this is actually a problem on non-Windows versions too, specifically when terminating a running app from another context than the running CLI.
The root cause seems to be that the main function invocation will sit in a long-polling FunctionGetOutputs
and wait for a result that will never come in since all tasks for the app have been killed, and in the meanwhile the app heartbeat will start to repeatedly fail since it gets an error once the app is shut down.
There are a few things I'd like to do to fix this "properly":
run_stub
gets an app_done
marker in the logs (or any other "shutdown" trigger), it should immediately trigger an asyncio termination
event that can be easily listened to by other parts of the system that are doing longpolls or heartbeat loops, and shut those down gracefully. This could replace the janky _set_ignore_cancellation
we've had on the Function object.Fix using method 2 above in: https://github.com/modal-labs/modal-client/pull/1452
Setup: Windows 10, running
python modal_app.py
After stopping an app through the web interface, the local command line application does not terminate. It keeps displaying messages like this: