This is an automated email from the ASF dual-hosted git repository.
shoothzj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git
The following commit(s) were added to refs/heads/master by this push:
new 6fa13ecdfc Add missed call to onReadRequestFinish() when read request
rejected (#3482)
6fa13ecdfc is described below
commit 6fa13ecdfca01d4d65d49c489484acc5755e616e
Author: Michael Marshall <[email protected]>
AuthorDate: Sun Sep 11 23:57:08 2022 -0700
Add missed call to onReadRequestFinish() when read request rejected (#3482)
Fixes: https://github.com/apache/bookkeeper/issues/2945
### Motivation
When a read request is rejected due to the limit on the number of reads
that can be enqueued, we need to decrement the metric for
`bookkeeper_server_READ_ENTRY_IN_PROGRESS` and release the `readsSemaphore`, if
it is not null.
### Changes
* Call `onReadRequestFinish()` for failures in the V2 and V3 request
processing logic.
### Observation
It looks like the V2 responses for this kind of failure are not throttled,
even when `throttleReadResponses` is true. We could call
`read.sendReadReqResponse(` to enable this throttling. I didn't change it here
because there might be a reason we're not throttling these small responses.
---
.../main/java/org/apache/bookkeeper/proto/BookieRequestProcessor.java | 2 ++
1 file changed, 2 insertions(+)
diff --git
a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieRequestProcessor.java
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieRequestProcessor.java
index 94f55eb3f0..d5650710f7 100644
---
a/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieRequestProcessor.java
+++
b/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieRequestProcessor.java
@@ -539,6 +539,7 @@ public class BookieRequestProcessor implements
RequestProcessor {
.setReadResponse(readResponse);
BookkeeperProtocol.Response resp = response.build();
read.sendResponse(readResponse.getStatus(), resp,
requestStats.getReadRequestStats());
+ onReadRequestFinish();
}
}
}
@@ -676,6 +677,7 @@ public class BookieRequestProcessor implements
RequestProcessor {
BookieProtocol.ETOOMANYREQUESTS,
ResponseBuilder.buildErrorResponse(BookieProtocol.ETOOMANYREQUESTS, r),
requestStats.getReadRequestStats());
+ onReadRequestFinish();
}
}
}