The stop() method on TimedBuffer class should be added to critical path of CriticalAnalyzer and it should be synchronised.
This is being applied in Artemis: https://github.com/apache/activemq-artemis/pull/1681
It is already applied in hornetq:
Author: Clebert Suconic <clebertsuconic>
Date: Wed Nov 29 14:58:07 2017 -0500
BZ-1518851 & BZ-1487313 Fixing TimedBuffer and File Sync
Verified with EAP 6.4.19.CP.CR2
Note: Included test is not executed automatically with any profile. Here is PR https://github.com/hornetq/hornetq/pull/2126 with fix.