Skip to content

Commit

Permalink
Revert "[fix] Key_Shared mode consumption latency when low traffic (#…
Browse files Browse the repository at this point in the history
…23340)"

This reverts commit 6404cc1.
  • Loading branch information
lhotari committed Sep 24, 2024
1 parent 6404cc1 commit 19c1419
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions conf/broker.conf
Original file line number Diff line number Diff line change
Expand Up @@ -470,12 +470,12 @@ dispatcherReadFailureBackoffMandatoryStopTimeInMs=0
# On Shared and KeyShared subscriptions, if all available messages in the subscription are filtered
# out and not dispatched to any consumer, message dispatching will be rescheduled with a backoff
# delay. This parameter sets the initial backoff delay in milliseconds.
dispatcherRetryBackoffInitialTimeInMs=1
dispatcherRetryBackoffInitialTimeInMs=100

# On Shared and KeyShared subscriptions, if all available messages in the subscription are filtered
# out and not dispatched to any consumer, message dispatching will be rescheduled with a backoff
# delay. This parameter sets the maximum backoff delay in milliseconds.
dispatcherRetryBackoffMaxTimeInMs=10
dispatcherRetryBackoffMaxTimeInMs=1000

# Precise dispatcher flow control according to history message number of each entry
preciseDispatcherFlowControl=false
Expand Down
4 changes: 2 additions & 2 deletions conf/standalone.conf
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,12 @@ dispatcherReadFailureBackoffMandatoryStopTimeInMs=0
# On Shared and KeyShared subscriptions, if all available messages in the subscription are filtered
# out and not dispatched to any consumer, message dispatching will be rescheduled with a backoff
# delay. This parameter sets the initial backoff delay in milliseconds.
dispatcherRetryBackoffInitialTimeInMs=1
dispatcherRetryBackoffInitialTimeInMs=100

# On Shared and KeyShared subscriptions, if all available messages in the subscription are filtered
# out and not dispatched to any consumer, message dispatching will be rescheduled with a backoff
# delay. This parameter sets the maximum backoff delay in milliseconds.
dispatcherRetryBackoffMaxTimeInMs=10
dispatcherRetryBackoffMaxTimeInMs=1000

# Precise dispatcher flow control according to history message number of each entry
preciseDispatcherFlowControl=false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1198,14 +1198,14 @@ The max allowed delay for delayed delivery (in milliseconds). If the broker rece
doc = "On Shared and KeyShared subscriptions, if all available messages in the subscription are filtered "
+ "out and not dispatched to any consumer, message dispatching will be rescheduled with a backoff "
+ "delay. This parameter sets the initial backoff delay in milliseconds.")
private int dispatcherRetryBackoffInitialTimeInMs = 1;
private int dispatcherRetryBackoffInitialTimeInMs = 100;

@FieldContext(
category = CATEGORY_POLICIES,
doc = "On Shared and KeyShared subscriptions, if all available messages in the subscription are filtered "
+ "out and not dispatched to any consumer, message dispatching will be rescheduled with a backoff "
+ "delay. This parameter sets the maximum backoff delay in milliseconds.")
private int dispatcherRetryBackoffMaxTimeInMs = 10;
private int dispatcherRetryBackoffMaxTimeInMs = 1000;

@FieldContext(
dynamic = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -696,12 +696,10 @@ private synchronized void handleSendingMessagesAndReadingMore(ReadType readType,
boolean triggerReadingMore = sendMessagesToConsumers(readType, entries, needAcquireSendInProgress);
int entriesDispatched = lastNumberOfEntriesDispatched;
updatePendingBytesToDispatch(-totalBytesSize);
if (entriesDispatched > 0) {
// Reset the backoff when we successfully dispatched messages
retryBackoff.reset();
}
if (triggerReadingMore) {
if (entriesDispatched > 0) {
// Reset the backoff when we successfully dispatched messages
retryBackoff.reset();
// Call readMoreEntries in the same thread to trigger the next read
readMoreEntries();
} else if (entriesDispatched == 0) {
Expand Down

0 comments on commit 19c1419

Please sign in to comment.