This repository has been archived by the owner on Jul 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle full queue better in RemoteReporter (#180)
* Fix RemoteReport race condition when queue is full The check “commandQueue.size() == maxQueueSize” is not thread safe, this lead to: java.lang.IllegalStateException: Queue full It’s better to .offer() and check the returned value * Fix RemoteReporter problems with command queue is full When the command queue is full it’s not possible to queue control commands - FlushCommand or CloseCommand. They were throwing exceptions. This change replaces BLockingQueue.add with BlockingQueue.offer to handle this situation. I’ve modified test InMemorySender to allow it to block. This makes it possible to easily fill the RemoteReporter’s command queue in tests. * RemoteReporter’s queue length metric update when queue full When the command queue is full further FlushCommands are not enqueued and queue length metric does not update. I moved it outside the command - now it updates whenever scheduled flush() executes.
- Loading branch information
1 parent
797ef4f
commit 4c06ea6
Showing
3 changed files
with
165 additions
and
11 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