-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FFM-10760] - Use a single ExecutorService for UpdateProcessor (#182)
* [FFM-10760] - Use a single ExecutorService for UpdateProcessor What - Change UpdateProcessor to use a single thread pool for the life time of the service - Updated `processFlag()` and `processSegment()` to catch `Throwable` to prevent executor threads dying - Drop some verbose logs to trace to make debug level more readable Why We are getting reports in the field that the following error message is being logged `Update processor is terminating/restarting. Update skipped: <EVENT JSON>` Looking at the code this can only happen if the SSE stream drops and we attempt to call `restart()` while events are still arriving from the old stream. We should modify the code to avoid creating/destroying the thread pool on each disconnect and instead use a single thread pool for the lifetime of the UpdateProcessor which is only destroyed when `close()` is called. This will allow the removal of the following defensive check and will help avoid dropping SSE messages that did make it before the disconnect: ``` if (executor.isShutdown() || executor.isTerminated()) { log.warn("Update processor is terminating/restarting. Update skipped: {}", message); return; } ```
- Loading branch information
1 parent
2d3606a
commit 7fd468d
Showing
6 changed files
with
31 additions
and
33 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