Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finagle-mux: rewrite server dispatcher
Problem My previous change to add metrics made it very obvious that the Mux server dispatcher was becoming increasingly difficult to reason about, especially in terms of session state. Solution Rewrite the server dispatcher in a more sustainable way. Indeed this process found more races. Among the changes are: * Separate out request processing from session management * Remove unnecessary configuration (canDispatch, ping), and move their functionality into a filter chain. * Introduce a separate transaction tracker that manages draining. * Introduce a fine-grained session state so that we can tell the difference between draining, client, and server hangups. This also introduces 4 new metrics to track draining stats: **draining** the number of times the server has initiated session draining **drained** the number of times the server has succesfully completed the draining protocol within its allotted time **clienthangup** the number of times sessions have been abruptly terminated by the client **serverhangup** the number of times sessions have been abruptly terminated by the server Result Much easier to reason about the server dispatcher code and session states. Smokestack old: mux 1000000 16555 bytes/iter muxsess 1000000 30348 bytes/iter new: mux 1000000 16867 bytes/iter muxsess 1000000 31555 bytes/iter RB_ID=580754
- Loading branch information
Showing
11 changed files
with
392 additions
and
290 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
**draining** | ||
the number of times the server has initiated session draining | ||
|
||
**drained** | ||
the number of times the server has succesfully completed the draining protocol within its allotted time | ||
|
||
**clienthangup** | ||
the number of times sessions have been abruptly terminated by the client | ||
|
||
**serverhangup** | ||
the number of times sessions have been abruptly terminated by the server | ||
|
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
Oops, something went wrong.