Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cells: Add fail fast behaviour for busy pools
Motivation: The idea is taken from the "Release It!" book. We already have support for discarding requests when their TTL is about to be exceeded. This allows a cell to recover more quickly/degrade more gracefully if it starts queuing requests, but it doesn't help the requesting cell as it still has to wait for the request to time out before it can try something else. The book suggests a fail fast addition in which a service rejects a request if based on the current request processing times it is unlikely that we can process the request before it expires. Modification: Tracks the time the last dequeued request spent in the request queue. Upon receiving a new request, if its TTL is smaller than the last queue time, we immediately reply to the requesting cell with an error indicating that the cell is busy. In case the queue is empty the estimated queue time is 0. The code avoids adding extra synchroniztion points beyond the access of a new volatile field. The price is that updates of the last queue time is subject to some race conditions in which the time used is not strictly the age of the last message dequeued (it could be that of a message that got dequeued simultaneously). Result: One will observe that cells a more inclined to fast failure rather than to hang and time out. Depending on the cell, it may choose to retry with another cell, e.g. a door could repeat pool selection if the pool states that it is busy. Target: trunk Require-notes: yes Require-book: yes Acked-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de> Patch: https://rb.dcache.org/r/8787/
- Loading branch information
Showing
3 changed files
with
44 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters