thswlsqls commented on code in PR #9291:
URL: https://github.com/apache/paimon/pull/9291#discussion_r3835244304
##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/service/QueryFileMonitor.java:
##########
@@ -94,12 +96,25 @@ public void start() {
this.read = readBuilder.newRead();
}
+ @Override
+ public CompletableFuture<Void> isAvailable() {
+ return availableFuture;
+ }
+
@Override
public InputStatus pollNext(ReaderOutput<InternalRow> readerOutput)
throws Exception {
boolean isEmpty = doScan(readerOutput);
if (isEmpty) {
- Thread.sleep(monitorInterval);
+ availableFuture =
+ CompletableFuture.runAsync(
Review Comment:
@JingsongLi Thanks — fixed. The delay now runs on a
`ScheduledExecutorService` owned by the reader and shut down in `close()`,
which also cancels the pending wake-up, so no common-pool worker is held. Two
tests drive it through `ManuallyTriggeredScheduledExecutorService`: concurrent
waits don't block each other, and `close()` cancels the pending one.
Worth flagging: `MonitorSource.Reader` has the identical `runAsync` +
`Thread.sleep` block on master, and this PR mirrored it deliberately (#6396) —
so this leaves the same behaviour in the more widely used source.
Happy to cover it here too, or follow up separately — whichever you prefer.
--
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]