Please sign in to comment.
Avoiding race condition on roster collection
Workers must not call save() when in the available=true state, because they would overwrite an assignment made by the Recruiter. Operations to be performed in any case like stillHere() have to execute an atomic query instead of storing a potentially stale full document. Moreover, signals have to be managed immediately before starting to talk with the database; in this way we can deal with very quick restarts by using the graceful shutdown.
- Loading branch information...
Showing with 34 additions and 21 deletions.