You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import os
from prefect import flow
def hi(*args, **kwargs):
print("hi 2")
@flow(log_prints=True, on_crashed=[hi])
def my_flow():
print("From my flow")
os.kill(os.getpid(), 9)
if __name__ == "__main__":
my_flow.serve()
And trigger on terminal
prefect deployment run 'my-flow/my-flow'
I can see the following logs, so everything is fine.
17:19:16.511 | INFO | prefect.flow_runs.runner - Runner 'my-flow' submitting flow run '711ea4e5-a583-4735-b3b1-f8c63104c00a'
17:19:16.537 | INFO | prefect.flow_runs.runner - Opening process...
17:19:16.547 | INFO | prefect.flow_runs.runner - Completed submission of flow run '711ea4e5-a583-4735-b3b1-f8c63104c00a'
17:19:17.705 | INFO | Flow run 'uncovered-serval' - Downloading flow code from storage at '.'
17:19:17.754 | INFO | Flow run 'uncovered-serval' - Running flow
17:19:17.754 | INFO | Flow run 'uncovered-serval' - From my flow
17:19:17.759 | INFO | prefect.flow_runs.runner - Process for flow run 'uncovered-serval' exited with status code: -9; This indicates that the process exited due to a SIGKILL signal. Typically, this is either caused by manual cancellation or high memory usage causing the operating system to terminate the process.
17:19:17.775 | INFO | prefect.flow_runs.runner - Reported flow run '711ea4e5-a583-4735-b3b1-f8c63104c00a' as crashed: Flow run process exited with non-zero status code -9.
17:19:17.806 | INFO | Flow run 'uncovered-serval' - Downloading flow code from storage at '.'
17:19:17.809 | INFO | Flow run 'uncovered-serval' - Running hook 'hi' in response to entering state 'Crashed'
17:19:17.809 | INFO | Flow run 'uncovered-serval' - Hook 'hi' finished running successfully
hi 2
However, if I execute this same code, but using WorkerProcess the hi hook is not being called.
17:26:43.206 | INFO | prefect.flow_runs.worker - Worker 'ProcessWorker 39a16187-b5cb-4302-8331-32269007291a' submitting flow run 'dab6fb54-0500-42d0-b36a-8e3c61ffe1f4'
17:26:43.276 | INFO | prefect.flow_runs.worker - Opening process...
17:26:43.291 | INFO | prefect.flow_runs.worker - Completed submission of flow run 'dab6fb54-0500-42d0-b36a-8e3c61ffe1f4'
17:26:44.483 | INFO | Flow run 'macho-dragon' - Running flow
17:26:44.484 | INFO | Flow run 'macho-dragon' - From my flow
17:26:44.488 | ERROR | prefect.flow_runs.worker - Process 63020 exited with status code: -9; This indicates that the process exited due to a SIGKILL signal. Typically, this is either caused by manual cancellation or high memory usage causing the operating system to terminate the process.
17:26:44.510 | INFO | prefect.flow_runs.worker - Reported flow run 'dab6fb54-0500-42d0-b36a-8e3c61ffe1f4' as crashed: Flow run infrastructure exited with non-zero status code -9.
Version info
>>> PREFECT_API_URL=http://127.0.0.1:4200/api prefect version
Version: 3.1.6
API version: 0.8.4
Python version: 3.11.9
Git commit: 1695bd09
Built: Mon, Dec 16, 2024 12:37 PM
OS/Arch: darwin/arm64
Profile: local
Server type: server
Pydantic version: 2.9.2
Server:
Database: sqlite
SQLite version: 3.43.2
I tried with Linux and doesn't work as well
Additional context
No response
The text was updated successfully, but these errors were encountered:
Bug summary
When running this code:
And trigger on terminal
I can see the following logs, so everything is fine.
However, if I execute this same code, but using WorkerProcess the
hi
hook is not being called.Assume my file is named
acme.py
Then running on terminal 1:
And then running on a terminal 2
I can see the following logs:
Version info
Additional context
No response
The text was updated successfully, but these errors were encountered: