CrynetLogistics commented on a change in pull request #18651:
URL: https://github.com/apache/flink/pull/18651#discussion_r813029451
##########
File path:
flink-connectors/flink-connector-base/src/main/java/org/apache/flink/connector/base/sink/writer/AsyncSinkWriter.java
##########
@@ -313,7 +329,14 @@ private void flushIfAble() {
*/
private void flush() {
while (inFlightRequestsCount >= maxInFlightRequests) {
- mailboxExecutor.tryYield();
+ try {
+ mailboxExecutor.yield();
+ } catch (InterruptedException e) {
+ getFatalExceptionCons()
+ .accept(
+ new InterruptedException(
+ "The mailbox thread was interrupted
while waiting for asynchronous write operations to complete."));
+ }
Review comment:
1. You mention that I am busy waiting in `flush()` method, and I
completely agree. I have made a change to using `.yield()` while there are too
many in flight requests. It will wait for one of the in flight requests to
complete before flushing and thereby creating its own in flight request.
--
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]