Skip to content

Is there a reason not to silently ignore secedes/rejoins when not on a worker? #4776

Answered by fjetter
ms7463 asked this question in General
Discussion options

You must be logged in to vote

That's a question about API design which is ultimately always also a matter of taste so this answer is subjective.

I believe an important factor in API design is the principle of least surprise which boils down to "An API should do what most users would anticipate it to do". An exception is usually raised if an assumption is invalidated or the expected result cannot be guaranteed for any other reason.

The secede and rejoin API calls are functions to remove (secede) a thread from the given worker thread pool such that it does not block an executing slot. Rejoin will revert this.
By this argumentation, calling secede in a thread which is not running on a worker both invalidates the assumpti…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ms7463
Comment options

Answer selected by ms7463
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants