Note that the patch is not even a PR at this moment...
We used to have problems where:
We scheduled a thread to clean replication tokens in 10s. But the trick is that right after that we would call replicationManager.stop() which would clean them all anyway.
[...]
besides that there were the following problems in server.stop() (related or not to replication.)
@Clebert, the patch above fixes ReplicatedPagedFailoverTest.testFailThenReceiveMoreMessagesAfterFailover2() for me (man, jboss.org forum interface sucks...)
@Clebert and @AndyTaylor can you guys take a look at https://github.com/FranciscoBorges/hornetq/commit/901d2173be390861a2055b51bcd46cc63c91b58c for obvious problems before I send a PR? (I would rather avoid merging this without a proper discussion).
looks ok to me, have you run the test suite against it?