This repository has been archived by the owner on Jan 24, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix concurrent modification exception. (#1493)
### Motivation There is some flaky test when we stop the brokers. ``` Error: Failures: Error: CacheInvalidatorTest.cleanup:111->KopProtocolHandlerTestBase.internalCleanup:319->KopProtocolHandlerTestBase.stopBroker:355->KopProtocolHandlerTestBase.stopBroker:351 » PulsarServer Error: TransactionWithOAuthBearerAuthTest.cleanup:72->TransactionTest.cleanup:77->KopProtocolHandlerTestBase.internalCleanup:319->KopProtocolHandlerTestBase.stopBroker:355->KopProtocolHandlerTestBase.stopBroker:351 » PulsarServer ``` The root cause is when we close the `TransactionMarkerChannelManager`, we will traverse all entries of `handlerMap`, but some of the entry already been removed, we can use `ConcurrentHashMap` to avoid it. ### Modifications Use `ConcurrentHashMap` instead of `HashMap`. (cherry picked from commit 533efbd)
- Loading branch information