-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cells: reduce latency when notifying caller than a message has timed out
Motivation: Cell message delivery is unreliable and the target of a cell message may be busy (so, delaying its response). Cell messages may be sent with a timout to handle these cases. Timeouts have two main benefits: First, it allows the message receiver to know when a response is no longer needed. Knowing this, the receiver can discard messages for which the response is no longer needed. Second, it provides a framework through which the cell that sends a message is notified if the response is taking too long. Currently, handling timed-out messages is done lazily, once every twenty seconds. This introduces a not insignificant latency: where the sender is notified of the message timeout between zero and twenty seconds after the message's actual timeout. There are situations where a door is expected to respond within a certain time-frame, and failing to do so could result in the client considering the door as having "frozen". Under these circumstances, introducing such a latency is unacceptable. Modification: Provide a framework through which the callbacks of timed-out messages are processed which greatly reduced latency. A priority queue is used to keep a list of callbacks, ordered by when they will time-out. The code ensures that, when there is at least one callback, there is also a task scheduled to run when the earliest callback will expire. Note that this task uses the background-processing thread, which it shares with other activity (in particular, updating information about cell-routing), which may introduce a very modest delay. If an expired callback could not be processed, it is retried with a twenty second delay. This is equivalent to the current behaviour. Result: dCache provides much more accurate timeout behaviour should it suffer message loss or cells are overloaded. This patch partially addresses #5642 Target: master Requires-notes: yes Requires-book: no Patch: https://rb.dcache.org/r/12754/ Acked-by: Tigran Mkrtchyan
- Loading branch information
1 parent
3e99233
commit cbbe2ce
Showing
2 changed files
with
105 additions
and
6 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