forked from elastic/kibana
-
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.
[Response Ops][Task Manager] Stop polling on Kibana shutdown (elastic…
…#195415) Resolves elastic#160329 ## Summary Stop polling when task manager `stop()` is called. When Kibana receives a `SIGTERM` signal, all the plugin stop functions are called. When TM receives this signal, it should immediately stop claiming any new tasks and then there is a grace period before kubernetes kills the pod that allows any running tasks to complete. I experimented with removing the code that prevents the event log from indexing any additional documents after the `stop` signal is received, but I received a bulk indexing error `There are no living connections` even thought Elasticsearch was up and running so it seems that some of the core functionality that the event log uses are gone at this point. ## To Verify 1. Add a log indicating that polling is occuring ``` --- a/x-pack/plugins/task_manager/server/polling/task_poller.ts +++ b/x-pack/plugins/task_manager/server/polling/task_poller.ts @@ -61,6 +61,7 @@ export function createTaskPoller<T, H>({ const subject = new Subject<Result<H, PollingError<T>>>(); async function runCycle() { + console.log('polling'); timeoutId = null; const start = Date.now(); try { ``` 2. Start ES and Kibana. Use `ps aux` to determine Kibana's PID 3. Send a sigterm signal to Kibana: `kill -TERM <kibana_pid>`. Task manager should log `Stopping the task poller` and you should no longer see the console logs indicating that TM is polling Co-authored-by: Elastic Machine <[email protected]>
- Loading branch information
1 parent
96eff23
commit 674027d
Showing
6 changed files
with
82 additions
and
9 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
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