forked from sensu/sensu-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use contexts for cancellation (sensu#2827)
Use contexts for cancellation through the agent application. This means threading a context through components that are also used in the backend, so the backend has been nominally modified as well. Note that cancellation problems still exist in the backend and will require a larger, focused effort to resolve. The Agent Stop() method has been removed, and Agent Run() now blocks until the agent context is cancelled. The asset manager now accepts a context, and will stop trying to retrieve assets when the context is cancelled. This prevents problems with asset managers never stopping, when assets cannot be retrieved. The agent's connection manager now stops trying to reconnect when a context cancellation is observed. Agents now shut down cleanly when SIGTERM and SIGINT are received. All in-progress HTTP connections are given 1s to shut down and are then terminated forcibly. Agents still block on SIGTERM and SIGINT, but the longer waits for shutdown should now be resolved. A second minor issue has also been resolved, where agents would always try to reconnect to the same backend. Signed-off-by: Eric Chlebek <[email protected]>
- Loading branch information
Showing
32 changed files
with
322 additions
and
267 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
### Fixed | ||
- Fixed a bug where agents would sometimes refuse to terminate on SIGTERM and | ||
SIGINT. | ||
- Fixed a bug where agents would always try to reconnect to the same backend, | ||
even when multiple backends were specified. Agents will now try to connect to | ||
other backends, in pseudorandom fashion. |
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.