This repository was archived by the owner on Jan 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 142
fix issue #252 bundle unload bug #404
Merged
BewareMyPower
merged 15 commits into
streamnative:master
from
hangc0276:chenhang/fix_bundle_unload_bug
Apr 22, 2021
Merged
fix issue #252 bundle unload bug #404
BewareMyPower
merged 15 commits into
streamnative:master
from
hangc0276:chenhang/fix_bundle_unload_bug
Apr 22, 2021
Conversation
This file contains hidden or 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
jiazhai
approved these changes
Mar 19, 2021
Collaborator
|
@hangc0276 Could you take a look at the test failure? It looks like the test is still unstable after the change. I think it may not be caused by the uncleaned static cache. |
Collaborator
Author
@BewareMyPower OK, maybe there are other bugs to cause this problem, it looks like caused by loadbalance, i will address it these days. |
tests/src/test/java/io/streamnative/pulsar/handlers/kop/DistributedClusterTest.java
Show resolved
Hide resolved
de67ff4 to
d5051c0
Compare
Collaborator
Author
38e6731 to
788d5db
Compare
Collaborator
|
@hangc0276 Could you take a look at the failed Also you can rebase to latest master because we ignored the unstable tests, see #444 |
5238a0b to
ef4f94c
Compare
BewareMyPower
approved these changes
Apr 22, 2021
BewareMyPower
added a commit
to BewareMyPower/openmessaging-benchmark
that referenced
this pull request
Apr 27, 2021
This was referenced Jul 1, 2021
This was referenced Jul 22, 2021
BewareMyPower
added a commit
that referenced
this pull request
Jul 23, 2021
This PR migrates #404 because it's too hard to cherry-pick them.
BewareMyPower
added a commit
that referenced
this pull request
Jul 23, 2021
Fixes #618 ### Motivation See #618 (comment) for the deadlock analysis. ### Modifications - Use `ConcurrentHashMap` instead of `ConcurrentLongHashMap`. Though this bug may already be fixed in apache/pulsar#9787, the `ConcurrentHashMap` from Java standard library is more reliable. The possible performance enhancement brought by `ConcurrentLongHashMap` still needs to be proved. - Use `AtomicBoolean` as `KafkaTopicConsumerManager`'s state instead of read-write lock to avoid `close()` method that tries to acquire write lock blocking. - Run a single cursor expire task instead one task per channel, since #404 changed `consumerTopicManagers` to a static field, there's no reason to run a task for each connection.
BewareMyPower
added a commit
to BewareMyPower/kop
that referenced
this pull request
Jul 25, 2021
Fixes streamnative#618 ### Motivation See streamnative#618 (comment) for the deadlock analysis. ### Modifications - Use `ConcurrentHashMap` instead of `ConcurrentLongHashMap`. Though this bug may already be fixed in apache/pulsar#9787, the `ConcurrentHashMap` from Java standard library is more reliable. The possible performance enhancement brought by `ConcurrentLongHashMap` still needs to be proved. - Use `AtomicBoolean` as `KafkaTopicConsumerManager`'s state instead of read-write lock to avoid `close()` method that tries to acquire write lock blocking. - Run a single cursor expire task instead one task per channel, since streamnative#404 changed `consumerTopicManagers` to a static field, there's no reason to run a task for each connection.
BewareMyPower
added a commit
that referenced
this pull request
Jul 25, 2021
Fixes #618 ### Motivation See #618 (comment) for the deadlock analysis. ### Modifications - Use `ConcurrentHashMap` instead of `ConcurrentLongHashMap`. Though this bug may already be fixed in apache/pulsar#9787, the `ConcurrentHashMap` from Java standard library is more reliable. The possible performance enhancement brought by `ConcurrentLongHashMap` still needs to be proved. - Use `AtomicBoolean` as `KafkaTopicConsumerManager`'s state instead of read-write lock to avoid `close()` method that tries to acquire write lock blocking. - Run a single cursor expire task instead one task per channel, since #404 changed `consumerTopicManagers` to a static field, there's no reason to run a task for each connection.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

Fix #252
Motivation
When bundle unload triggered, the
consumerTopicManagerscache won't be evicted and it will return the oldKafkaTopicConsumerManagerinstance in the next fetch request handle. However, after bundle unload, the producer/consumer/managedLedger of topics in related bundle will be closed. If we use oldKafkaTopicConsumerManagerinstance to read messages, it will returnmanagedLedger has been closedexception.Changes
consumerTopicManagers,topics,referencesmap to static attribute ConcurrentHashMap.DistributedClusterTest.