ueshin commented on code in PR #42422:
URL: https://github.com/apache/spark/pull/42422#discussion_r1293832373
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/python/UserDefinedPythonFunction.scala:
##########
@@ -273,9 +289,13 @@ object UserDefinedPythonTableFunction {
case eof: EOFException =>
throw new SparkException("Python worker exited unexpectedly
(crashed)", eof)
} finally {
- if (!releasedOrClosed) {
- // An error happened. Force to close the worker.
- env.destroyPythonWorker(pythonExec, workerModule,
envVars.asScala.toMap, worker)
+ try {
+ bufferStream.close()
+ } finally {
+ if (!releasedOrClosed) {
+ // An error happened. Force to close the worker.
+ env.destroyPythonWorker(pythonExec, workerModule,
envVars.asScala.toMap, worker)
+ }
Review Comment:
#42385 changed to use `bufferStream = new DirectByteBufferOutputStream()`,
but it was not closed.
--
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]