Skip to content

Issue 135: Prune scheduling issue#136

Merged
davramov merged 8 commits intoals-computing:mainfrom
davramov:issue_135
Apr 30, 2026
Merged

Issue 135: Prune scheduling issue#136
davramov merged 8 commits intoals-computing:mainfrom
davramov:issue_135

Conversation

@davramov
Copy link
Copy Markdown
Contributor

This PR addresses issue #135, where a flow that uses the prune controller "completes" before pruning is actually scheduled, resulting in a Execution was cancelled by the runtime environment.

Now in GlobusPruneController, I have wrapped the schedule_prefect_flow call that will block until the future result is returned, to ensure that the flow does not complete until pruning is scheduled:

                future = schedule_prefect_flow.submit(
                    deployment_name="prune_globus_endpoint/prune_globus_endpoint",
                    flow_run_name=flow_name,
                    parameters={
                        "relative_path": file_path,
                        "source_endpoint": source_endpoint,
                        "check_endpoint": check_endpoint,
                        # "config": self.config
                    },
                    duration_from_now=days_from_now,
                )
                future.result()

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes Prefect prune scheduling race (Issue #135) by ensuring the prune-scheduling task fully completes (and the scheduled flow run is created) before the calling flow/task can finish, preventing “Execution was cancelled by the runtime environment” from aborting scheduling.

Changes:

  • Block on the schedule_prefect_flow.submit(...) future in GlobusPruneController.prune() via future.result() to guarantee scheduling completes.
  • Use Prefect’s run logger (get_run_logger) in FileSystemPruneController.prune() for Prefect-context logging.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread orchestration/prune_controller.py Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@davramov davramov marked this pull request as ready for review April 30, 2026 19:34
@davramov davramov merged commit cabe044 into als-computing:main Apr 30, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants