-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix some timers and deprecate RequestLog::switchTiming --We forgot to stop the `DataApiRequest` timer. --When timing the posting of the Druid Query we failed to account for the thread hopping during asynchronous programming. As a result, not only were we failing to stop the timer in the correct instance of the RequestLog (the one that is used by the response handling thread), but we also attempted to stop a timer in a RequestLog that has since been cleared. So we end up with two warnings: One for attempting to stop a timer that doesn't exist, and one for logging a timer that was never stopped. Since there isn't a good way to time just the posting of the druid query, and it probably isn't necessary anyway, the timing has been removed. --`RequestLog::switchTiming` works by stopping the most recent timer, and then starting the specified timer. As a result, we can fail to stop a timer A if we start and stop timer B inside a method invoked while timer A is running. As a result, in order to ensure that all of your timers are working correctly, you need to be cognizant of the internal workings of every method you invoke within the timed block. --Therefore, in an effort to make timed code more modular, we've removed the `RequestLog::switchTiming` method, and replaced all instances of it with try-finally blocks that explicitly stop and start each timer. It's ugly, but it's also much less brittle.
- Loading branch information
Showing
4 changed files
with
105 additions
and
74 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