CrynetLogistics commented on a change in pull request #18651:
URL: https://github.com/apache/flink/pull/18651#discussion_r813374887



##########
File path: 
flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/sink/writer/AsyncSinkWriter.java
##########
@@ -290,17 +290,33 @@ private void registerCallback() {
     @Override
     public void write(InputT element, Context context) throws IOException, 
InterruptedException {
         while (bufferedRequestEntries.size() >= maxBufferedRequests) {
-            mailboxExecutor.tryYield();
+            flush();

Review comment:
       9. Additionally to align with @pnowojski 's example, in this sink, we:
   a) start flushing if `sizeOfBuffer >= maxBatchSize` or `sizeOfBufferBytes >= 
maxBatchSizeInBytes`
   b) block new flushes once `inFlightRequestsCount` >= `maxInFlightRequests`
    - unblock as soon as the condition does not hold true
   c) block new writes if the buffer is full
    - unblock as soon as the condition does not hold true




-- 
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