[Fix] Message is blocked on the AckGroupingTracker.isDuplicate method. #986
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.
Master Issue: #979
Motivation
The root cause is
internalReceivedCommand
will be blocked bytimedAckGroupingTracker.isDuplicate
.pulsar-client-go/pulsar/internal/connection.go
Lines 421 to 422 in 75d2df3
Then, the subsequent commands under this
connection
cannot be processed, resulting in a timeout.Failed logs
#957 introduced the
AckGroupingTracker
. If a consumer calls close, it will closedAckGroupingTracker
, This exits the loop.pulsar-client-go/pulsar/ack_grouping_tracker.go
Lines 116 to 118 in ebc025e
This will course in never getting
duplicateResultCh
messages and be blocked here.pulsar-client-go/pulsar/ack_grouping_tracker.go
Line 282 in 7d257b0
In this test, when called
c1.close() or c2.close()
, there may bemessage cmd
pushed over and eventually blocked by theisDuplicate
method.pulsar-client-go/pulsar/consumer_test.go
Lines 1002 to 1018 in 42ded0d
Modifications
sync.mutex
instead ofselect channel
to refactorAckGroupingTracker
.Verifying this change
TestDuplicateAfterClose
to cover it.Documentation