Mrhs121 commented on PR #10060:
URL: https://github.com/apache/seatunnel/pull/10060#issuecomment-4622666555

   @davidzollo  Thanks for the detailed review.
   
   I agree with the concern. Calling generic `sinkWriter.close()` from Spark 
2.4 `abort()` is unsafe, because `close()` is not guaranteed to be 
resource-only. For Doris non-2PC mode, it can flush buffered records, so it 
should not be called from the rollback path.
   
   I also checked Spark 2.4 again. Unlike Spark 3.x, Spark 2.4's `DataWriter` 
does not extend `Closeable`, and Spark 2.4 does not call `close()` in a finally 
block. So simply making SeaTunnel's Spark 2.4 `SparkDataWriter` implement 
`Closeable` would not solve this.
   
   Currently I don't see an elegant generic fix for Spark 2.4 here. I will 
remove the Spark 2.4 abort-close changes from this PR first and keep this PR 
focused on the Doris shutdown fix. A resource-only cleanup path  for Spark 2.4 
can be discussed in a separate follow-up.


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