Skip to content

Commit

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

This reverts commit e1bd313.
  • Loading branch information
lhotari committed Sep 24, 2024
1 parent e1bd313 commit ca75892
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 @@ -465,12 +465,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 dispathcer 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 @@ -281,12 +281,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 dispathcer 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 @@ -1177,14 +1177,14 @@ The delayed message index time step(in seconds) in per bucket snapshot segment,
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 @@ -649,12 +649,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 ca75892

Please sign in to comment.