hulincup opened a new pull request, #685:
URL: https://github.com/apache/doris-flink-connector/pull/685
## What
DorisSourceSplitReader.close() (the FLIP-27 source split reader) did not
swallow exceptions from valueReader.close() (thrift closeScanner) nor null the
field afterward. On task teardown/cancellation, a throwing closeScanner
propagated into the main flow and aborted cleanup; on repeated close() calls
the reader was double-closed (not idempotent — DorisValueReader.close()
re-locks and calls closeScanner again on a possibly-already-closed TSocket).
## Root cause
close() was `if (valueReader != null) { valueReader.close(); }` — no
try/catch (exceptions propagate), no field-nulling (double-close re-invokes).
## Fix
Wrap valueReader.close() in try/catch+finally: swallow + LOG.warn (same
message as the file's own finishSplit()), null the field in finally. Route
checkSplitOrStartNext() through a protected createValueReader hook to make
close() unit-testable without a real BE.
## Tests
New DorisSourceSplitReaderTest (4 cases): close releases the reader once;
no-op when no reader; throwing close() swallowed + field nulled in finally;
idempotency under repeated close().
## Non-goal (out of scope)
Extracting a shared closeValueReader() helper between finishSplit() and
close() is a clean refactor but deferred — this PR stays a focused bug fix to
close().
## Related
Complements #684 (same leak pattern in the legacy RichInputFormat path,
DorisRowDataInputFormat). Different file, no conflict. Note: open PR #679
refactors this class's generics (List→DorisSourceRecord); if it merges first, a
rebase of this branch will resolve the textual conflict in
fetch()/checkSplitOrStartNext() — the close() fix itself is orthogonal.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]