Skip to content

Conversation

@rustworthy
Copy link
Collaborator

@rustworthy rustworthy commented Mar 21, 2024

As per #4


This change is Reviewable

@rustworthy
Copy link
Collaborator Author

@jonhoo I think all the threads have been addressed.

I thing that I have just realized is that we do not allow to Worker::run a terminated worker, and we drop the processing workers we have spawned, but Worker::run_one is still possible since the coordinating worker is not dropped.

Imagine the situation where the server told us to stop the consumption (we get this message in the heartbeat task on the coordinator), and we do so and mark the coordinator as terminated. What they can do then is take this worker and call run_one in a loop mimicking this way the Worker::run logic, but without HEARTBEATing and - most importantly - breaking the server instruction we've received previously. I think this is not something we want to be possible, wdyt?

@rustworthy rustworthy requested a review from jonhoo July 19, 2024 06:29
Copy link
Owner

@jonhoo jonhoo left a comment

Choose a reason for hiding this comment

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

Hmm, it's a good point. I think I agree that run_one also shouldn't be possible once terminated 👍

@rustworthy rustworthy requested a review from jonhoo July 21, 2024 08:23
@jonhoo jonhoo merged commit a63b658 into main Jul 21, 2024
@rustworthy rustworthy deleted the feat/sigterm-handling branch August 9, 2024 11:27
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.

3 participants