hulincup opened a new pull request, #684:
URL: https://github.com/apache/doris-flink-connector/pull/684

   ## What
   DorisRowDataInputFormat.close() was empty and never released the ValueReader 
created in open(), leaking a BE thrift BackendClient (open TSocket + unclosed 
scan contextId) on every split teardown, task cancellation, and failure. 
Present since the file's introduction in 2021; survives on current master.
   
   ## Root cause
   open() constructs a DorisValueReader (holds a thrift BackendClient → TSocket 
to a Doris BE + a scan contextId from open_scanner). close() did nothing, so 
neither close_scanner nor the socket was ever released.
   
   ## Fix
   Implement close() with a null guard and best-effort valueReader.close() 
(swallowing exceptions + LOG.warn, matching BackendClient.closeScanner 
best-effort semantics), nulling the field in finally. Route open() through a 
protected createValueReader hook to make close() unit-testable without a real 
BE.
   
   ## Tests
   New DorisRowDataInputFormatTest (the class previously had none), 4 cases 
covering: reader released exactly once after open+close; no-op when open() 
never called; throwing close() swallowed with the field nulled in finally; and 
close() idempotency under repeated calls.
   
   ## Non-goal (out of scope)
   Routing the InputFormat path through ValueReader.createReader (Arrow Flight 
SQL) is a separate behavioral change and is intentionally not included.


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

Reply via email to