lindong28 commented on code in PR #147: URL: https://github.com/apache/flink-ml/pull/147#discussion_r952697442
########## flink-ml-iteration/src/main/java/org/apache/flink/iteration/operator/HeadOperator.java: ########## @@ -607,16 +596,27 @@ public boolean tryYield() throws FlinkRuntimeException { * @param unit the time unit of the {@code time} argument */ private void yield(long time, TimeUnit unit) throws InterruptedException { - final ReentrantLock lock = this.lock; - lock.lock(); - try { - if (!mailboxExecutor.tryYield()) { - notEmpty.await(time, unit); - mailboxExecutor.tryYield(); - } - } finally { - lock.unlock(); + if (mailboxExecutor.tryYield()) { + return; } + + timer.schedule( + new TimerTask() { + @Override + public void run() { + try { Review Comment: Would it be simpler to just do the following: ``` try { mailboxExecutor.execute( () -> {}, "NoOp runnable to trigger yield timeout"); } catch (RejectedExecutionException ignored) { } ``` -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org