Rangsh commented on PR #12081:
URL: https://github.com/apache/seatunnel/pull/12081#issuecomment-7301195230

   Hi @SEZ9 — short follow-up, Point 1 only. Same code at `7c9e0f192c` and 
`cde67b24e5`.
   
   No-arg `RequestFuture#get()` delegates to the timed overload and wraps 
expiry (`RequestFuture` 98–106):
   
   ```java
   public Boolean get() throws InterruptedException, ExecutionException {
       try {
           return get(untimedGetTimeoutMillis, TimeUnit.MILLISECONDS);
       } catch (TimeoutException e) {
           throw new ExecutionException(
                   "Timed out waiting for WAL append completion after "
                           + untimedGetTimeoutMillis
                           + " ms",
                   e);
       }
   }
   ```
   
   Production waits use the timed overload, then remove the cache entry in 
`finally` (`IMapFileStorage#queryExecuteStatusBeforeDeadline`, 423–446). The 
batch path does the same per key (`batchQueryExecuteFailsStatus`, 485).
   
   ```java
   try {
       long remainingNanos = Math.max(0L, deadlineNanos - 
nanoTimeSource.getAsLong());
       if (remainingNanos == 0L) {
           return Boolean.TRUE.equals(requestFuture.get(0L, 
TimeUnit.NANOSECONDS));
       }
       return Boolean.TRUE.equals(requestFuture.get(remainingNanos, 
TimeUnit.NANOSECONDS));
   } catch (TimeoutException e) {
       log.warn(
               "wait for write status timed out for requestId {} after {} ms 
(shared limit {} ms)",
               requestId, elapsedMs, this.writDataTimeoutMilliseconds);
       log.debug("wait for write status timed out for requestId {}", requestId, 
e);
   } catch (Exception e) {
       log.error("wait for write status error for requestId {}", requestId, e);
   } finally {
       RequestFutureCache.remove(requestId);
   }
   return false;
   ```
   
   **Error:** the WAL write path catches `Exception` only (`WALWorkHandler` 
112). An `Error` from `writer.write` is not caught, `done()` is not called, and 
that event can kill the worker. The caller is already in the timed `get` above, 
so when the deadline expires it gets `TimeoutException`, the `finally` block 
removes the cache entry, and the method returns `false` (persistence failure 
for that key). It does not block past the deadline.


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