vahmed-hamdy commented on a change in pull request #18880:
URL: https://github.com/apache/flink/pull/18880#discussion_r812138243



##########
File path: 
flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/sink/writer/AsyncSinkWriter.java
##########
@@ -366,10 +430,19 @@ private void flush() {
      *
      * @param failedRequestEntries requestEntries that need to be retried
      */
-    private void completeRequest(List<RequestEntryT> failedRequestEntries, 
long requestStartTime) {
+    private void completeRequest(
+            List<RequestEntryT> failedRequestEntries, int messages, long 
requestStartTime) {
         lastSendTimestamp = requestStartTime;
         ackTime = System.currentTimeMillis();
         inFlightRequestsCount--;
+        inFlightMessages -= messages;

Review comment:
       `failedRequestEntries` are re-enqueued to buffer, they are going to be 
recounted on the next time they are sent downstream. I believe ` 
inFlightMessages += failedRequestEntries.size()` is unnecessary.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to