Rangsh commented on PR #12081: URL: https://github.com/apache/seatunnel/pull/12081#issuecomment-5618029821
@SEZ9 @DanielLeens thanks for reopening F4 on the mid-file case rather than treating the trailing-only reader guard as sufficient — agreed with the re-trace. Pushed **`1de6f1b88`** to close the “torn-then-more-writes” gap: ### F4 (mid-file torn record) Continuing APPEND on the same open stream after a write failure is exactly what could turn a trailing partial frame into a mid-file tear that `DefaultReader` cannot resync past (`break` when the length prefix claims more bytes than remain → later intact frames are silently dropped). Blind `fs.create` reopen is still avoided because it would truncate the fixed `wal.txt` path. **Fix:** `WALWorkHandler` now **fail-closes** further APPEND after any write failure (`appendBlockedAfterWriteFailure`): subsequent APPEND events complete with `done(false)` and **do not touch the stream**, so any partial frame stays a trailing incomplete record (recoverable by the existing trailing-frame stop). **Tests:** - `DefaultReaderTornMidFileRecordTest` — makes the mid-file behavior explicit: complete + torn + later complete → only the first record is returned; later intact frame is dropped. - `WALWorkHandlerSurvivabilityTest` — still proves the worker is not killed by a non-`IOException`, and now asserts the second APPEND is fail-closed without a second `writer.write()` call. - `DefaultReaderTornTrailingRecordTest` Javadoc updated to state it covers **trailing** only and points at the mid-file test + fail-closed policy. ### Status map (vs `1de6f1b88`) | Item | Status | | --- | --- | | **F1 / F3 / F7** RequestFuture contract + method Javadoc | resolved (unchanged this push) | | **F2** catch-`Exception` + guarded `executeResponse` | resolved; survivability test still covers non-kill | | **F4** torn-then-more-writes | addressed by fail-closed APPEND + mid-file reader test | | **F5** Mockito in module POM | resolved | | **F6** shared batch deadline + clamp | resolved | | **F8** timeout WARN + DEBUG stack | resolved | Happy to do a final pass once you’ve checked `1de6f1b88` against the mid-file F4 concern. -- 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]
