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

Fix bug where paused work queues getting unpaused and set to active on worker poll #14082

Merged
merged 2 commits into from
Jun 17, 2024

Conversation

collincchoy
Copy link
Contributor

@collincchoy collincchoy commented Jun 17, 2024

This PR fixes a bug (regression from #13117) where a paused work queue gets automatically unpaused on worker poll.

Closes #13935

Checklist

  • This pull request references any related issue by including "closes <link to issue>"
    • If no issue exists and your change is not a small fix, please create an issue first.
  • If this pull request adds new functionality, it includes unit tests that cover the changes
  • This pull request includes a label categorizing the change e.g. maintenance, fix, feature, enhancement, docs.

For documentation changes:

  • This pull request includes redirect settings in mint.json for files that are removed or renamed.

For new functions or classes in the Python SDK:

  • This pull request includes helpful docstrings.
  • If a new Python file was added, this pull request contains a stub page in the Python SDK docs and an entry in docs/mint.json navigation.

@collincchoy collincchoy added the fix A fix for a bug in an existing feature label Jun 17, 2024
@collincchoy collincchoy requested review from zangell44 and a team as code owners June 17, 2024 17:08
@@ -374,7 +374,7 @@ async def get_scheduled_flow_runs(

polled_work_queue_ids = [wq.id for wq in work_queues]
ready_work_queue_ids = [
wq.id for wq in work_queues if wq.status != WorkQueueStatus.READY
Copy link
Contributor Author

Choose a reason for hiding this comment

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

when wq.status == WorkQueueStatus.PAUSED, this is erroneously setting those work queues to READY

Copy link
Collaborator

Choose a reason for hiding this comment

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

Great find! Do we have a simiarl issue in Prefect Cloud as well, or does it use a different mechanism?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be good.

https://github.com/PrefectHQ/nebula/blob/ba07d73806589cc5225dda266c6ee02915d19a9f/src/prefect_cloud/orion/api/workers.py#L624-L628

I'm still looking into another closely related issue, but this should fix one bug.

@@ -374,7 +374,7 @@ async def get_scheduled_flow_runs(

polled_work_queue_ids = [wq.id for wq in work_queues]
ready_work_queue_ids = [
wq.id for wq in work_queues if wq.status != WorkQueueStatus.READY
Copy link
Collaborator

Choose a reason for hiding this comment

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

Great find! Do we have a simiarl issue in Prefect Cloud as well, or does it use a different mechanism?

@collincchoy collincchoy mentioned this pull request Jun 17, 2024
5 tasks
@collincchoy collincchoy merged commit cfd0eeb into main Jun 17, 2024
26 checks passed
@collincchoy collincchoy deleted the fix/paused-work-queues-auto-unpaused-to-active branch June 17, 2024 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix A fix for a bug in an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Confusing work queue status in the UI
2 participants