Netflix/Hystrix — pull request #114 by benjchristensen (2013-02-27 06:18:50+00:00)
Title: HystrixCollapser Refactor for Performance and Concurrency Bug Fixes

HystrixCollapser: Response Not Received https://github.com/Netflix/Hystrix/issues/80

- refactored HystrixTimer to be multi-threaded and use ScheduledThreadPoolExecutor to achieve this
- refactored HystrixCollapser to:
- timeout on wait and trigger batch execution from calling thread instead of relying on only background timer
- use single CountDownLatch per batch rather than 2 per collapsed requests to dramatically reduce number of items being waited on
- changed how batches are defined so the creation of a batch is a simpler step without a loop over all requests to register with the batch

Testing on a production canary shows these changes have given significant efficiency and thus performance gains.

I have tested it against 3 different applications including the Netflix API using a production canary.