Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove some log noise in pause and abort handling #17014

Merged
merged 1 commit into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions src/prefect/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,13 @@
else:
run_flow(flow, flow_run=flow_run, error_logger=run_logger)

except Abort as abort_signal:
abort_signal: Abort
except Abort:
engine_logger.info(
f"Engine execution of flow run '{flow_run_id}' aborted by orchestrator:"
f" {abort_signal}"
"Engine execution of flow run '{flow_run_id}' aborted by orchestrator."
)
exit(0)
except Pause as pause_signal:
pause_signal: Pause
engine_logger.info(
f"Engine execution of flow run '{flow_run_id}' is paused: {pause_signal}"
)
except Pause:
engine_logger.info(f"Engine execution of flow run '{flow_run_id}' is paused.")
exit(0)
except Exception:
engine_logger.error(
Expand Down
16 changes: 8 additions & 8 deletions src/prefect/flow_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -1518,6 +1518,8 @@ def run_flow(
ret_val = run_flow_async(**kwargs)
else:
ret_val = run_flow_sync(**kwargs)
except (Abort, Pause):
raise
except:
if error_logger:
error_logger.error(
Expand Down Expand Up @@ -1597,20 +1599,18 @@ def run_flow_with_env(
# This is running in a brand new process, so there won't be an existing
# event loop.
asyncio.run(maybe_coro)
except Abort as abort_signal:
abort_signal: Abort
except Abort:
if flow_run:
msg = f"Execution of flow run '{flow_run.id}' aborted by orchestrator: {abort_signal}"
msg = f"Execution of flow run '{flow_run.id}' aborted by orchestrator."
else:
msg = f"Execution aborted by orchestrator: {abort_signal}"
msg = "Execution aborted by orchestrator."
engine_logger.info(msg)
exit(0)
except Pause as pause_signal:
pause_signal: Pause
except Pause:
if flow_run:
msg = f"Execution of flow run '{flow_run.id}' is paused: {pause_signal}"
msg = f"Execution of flow run '{flow_run.id}' is paused."
else:
msg = f"Execution is paused: {pause_signal}"
msg = "Execution is paused."
engine_logger.info(msg)
exit(0)
except Exception:
Expand Down