-
Notifications
You must be signed in to change notification settings - Fork 5.3k
listener manager: implement graceful draining using a local drain man… #1219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c1d58c1
ac45a6d
079675b
5961da5
44abbb8
2c4cfd8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,20 +8,17 @@ namespace Envoy { | |
| namespace Server { | ||
|
|
||
| /** | ||
| * Handles connection draining. An instance is generally shared across the entire server. | ||
| * Handles connection draining. This concept is used globally during hot restart / server draining | ||
| * as well as on individual listeners when they are being dynamically removed. | ||
| */ | ||
| class DrainManager : public Network::DrainDecision { | ||
| public: | ||
| /** | ||
| * @return TRUE if the manager is currently draining connections. | ||
| * Invoked to begin the drain procedure. (Making drain close operations more likely). | ||
| * @param completion supplies the completion that will be called when the drain sequence is | ||
| * finished. The parameter is optional and can be an unassigned function. | ||
| */ | ||
| virtual bool draining() PURE; | ||
|
|
||
| /** | ||
| * Invoked in the secondary process to begin the drain procedure. (Making drain close operations | ||
| * more likely). | ||
| */ | ||
| virtual void startDrainSequence() PURE; | ||
| virtual void startDrainSequence(std::function<void()> completion) PURE; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we drain globally on each LDS update? This seems reasonable given the current semantics (each LDS refresh is an update of the complete set of listeners), but won't this also preclude the possibility of skipping the drain on listeners that aren't being modified (i.e. they have the same config hash)?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, I see, we create a new drain manager per listener as well as the singleton per-server. Makes sense (could be called out in some comment as well).
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK will find a comment to add to. |
||
|
|
||
| /** | ||
| * Invoked in the newly launched primary process to begin the parent shutdown sequence. At the end | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this is optional (could be unassigned std::function) from the code below. Might be useful to call that out here.