hawk9821 commented on code in PR #13201:
URL: https://github.com/apache/seatunnel/pull/13201#discussion_r4547333802


##########
seatunnel-api/src/main/java/org/apache/seatunnel/api/sink/multitablesink/MultiTableSinkWriter.java:
##########
@@ -850,21 +872,24 @@ public void abortPrepare() {
     /**
      * Closes this writer and releases all resources.
      *
-     * <p>Drains remaining queues, then calls {@link 
ExecutorService#shutdownNow()} to interrupt all
-     * consumer threads. Each sub-writer is closed under its respective {@link
-     * MultiTableWriterRunnable} lock to avoid concurrent access. Finally, the 
shared {@link
+     * <p>Signals any active timer flush round to stop, drains pending writes, 
and interrupts the
+     * executor threads. After any in-progress table isolation finishes, each 
sub-writer is closed
+     * under its queue lock, which also protects any in-flight flush. Finally, 
the shared {@link
      * MultiTableResourceManager} is closed and this method waits for the 
executor threads to stop.
      *
      * <p>Uses first-exception-wins error handling: if multiple sub-writers 
throw during close, only
      * the first exception is propagated. Resource manager close errors are 
logged but not
      * propagated.
      *
-     * @throws RuntimeException wrapping the first {@link Throwable} caught 
from any sub-writer;
-     *     note that the method signature declares {@code throws IOException} 
(inherited from the
-     *     interface), but the current implementation always wraps in {@code 
RuntimeException}
+     * @throws IOException if shutdown reports failed tables for a batch job
+     * @throws RuntimeException if shutdown fails without a batch failed-table 
report
      */
     @Override
     public void close() throws IOException {
+        CompletableFuture<Throwable> flush = 
activeTimerFlush.getAndSet(TIMER_FLUSH_CLOSED);

Review Comment:
   Makes sense. Given the low probability of hitting this edge case in normal 
operations and that it's a pre-existing issue across sink implementations, I 
agree it shouldn't block this PR. Let's handle it in a follow-up. Thanks for 
the discussion!



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