Skip to content

Activity worker: refactoring part 2 #899

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

Merged
merged 2 commits into from
Jun 23, 2025
Merged

Conversation

dandavison
Copy link
Contributor

@dandavison dandavison force-pushed the activity-worker-refactor-2 branch from 0fde874 to 8213e5e Compare June 14, 2025 22:09
@dandavison dandavison marked this pull request as ready for review June 22, 2025 14:28
@dandavison dandavison requested a review from a team as a code owner June 22, 2025 14:28
@dandavison dandavison force-pushed the activity-worker-refactor-2 branch from 8213e5e to 8d3f066 Compare June 22, 2025 14:28
async def wait_all_completed(self) -> None:
running_tasks = [v.task for v in self._running_activities.values() if v.task]
if running_tasks:
await asyncio.gather(*running_tasks, return_exceptions=False)
await asyncio.gather(*running_tasks, return_exceptions=True)
Copy link
Member

Choose a reason for hiding this comment

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

This makes sense to me (we don't want to return until all tasks are complete) except now this swallows exceptions. Has this logic been hit and is raising somehow today? I suspect we did mean to have this be return_exceptions=True originally, just want to confirm whether there is something observed precipitating this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's leave this for a PR focused specifically on changing that. Perhaps we want to consume the stream and re-raise any exceptions encountered. We'd discussed this previously at #860 (comment) and concluded that we felt it should be changed. Also I'm going to want the Nexus worker to do the thing we think is right. But, I've reverted this change: let's merge this PR with the pure refactoring (it will keep activity and nexus workers consistent) and kick this issue down the road one more time.

Copy link
Member

@cretz cretz Jun 23, 2025

Choose a reason for hiding this comment

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

Works for me. May want to change PR title/description.

@dandavison dandavison force-pushed the activity-worker-refactor-2 branch from 8d3f066 to f13fdc6 Compare June 23, 2025 15:27
@dandavison dandavison changed the title Activity worker: don't raise on wait_all_completed + refactoring Activity worker: refactoring part 2 Jun 23, 2025
@dandavison dandavison enabled auto-merge (squash) June 23, 2025 15:39
@dandavison dandavison force-pushed the activity-worker-refactor-2 branch from f13fdc6 to ea31487 Compare June 23, 2025 23:33
@dandavison dandavison merged commit 4a18f1f into main Jun 23, 2025
15 checks passed
@dandavison dandavison deleted the activity-worker-refactor-2 branch June 23, 2025 23:49
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