This repository has been archived by the owner on Jan 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 139
[Transaction] Fix concurrent modification exception when broker close #1493
Merged
BewareMyPower
merged 1 commit into
streamnative:master
from
Demogorgon314:Demogorgon314/Fix-ConcurrentModificationException
Sep 15, 2022
Merged
[Transaction] Fix concurrent modification exception when broker close #1493
BewareMyPower
merged 1 commit into
streamnative:master
from
Demogorgon314:Demogorgon314/Fix-ConcurrentModificationException
Sep 15, 2022
Conversation
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
6085032
to
a7bb789
Compare
BewareMyPower
approved these changes
Sep 15, 2022
Demogorgon314
added a commit
that referenced
this pull request
Sep 15, 2022
### 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)
BewareMyPower
pushed a commit
that referenced
this pull request
Sep 15, 2022
### 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)
Demogorgon314
added a commit
that referenced
this pull request
Sep 20, 2022
### 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)
Demogorgon314
added a commit
that referenced
this pull request
Sep 28, 2022
### 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)
michaeljmarshall
pushed a commit
to michaeljmarshall/kop
that referenced
this pull request
Dec 13, 2022
### 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)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
There is some flaky test when we stop the brokers.
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 ofHashMap
.Documentation
Check the box below.
Need to update docs?
doc-required
(If you need help on updating docs, create a doc issue)
no-need-doc
(Please explain why)
doc
(If this PR contains doc changes)