Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Consider a script which (A) creates and actor and (B) submits a task to that actor.
(A) will send a message, call it message (1) (via Redis) to the local scheduler responsible for the actor. When message (1) arrives, the local scheduler will create a new worker to run the actor.
(B) will send a message, call it message (2) to the local scheduler responsible for the actor. When message (2) arrives, the local scheduler will queue the task and potentially give it to the newly created worker to execute.
However, in the rare situation where message (2) arrives before message (1), we cannot give the task to the worker yet because the worker hasn't been created. However, it looks like we were trying to do so.
Now that I think about it, another fix would be to just change
dispatch_actor_task
to return without doing anything if message (1) has not arrived yet instead of failing. UPDATE: I changed it to this approach.