Github user HyukjinKwon commented on a diff in the pull request: https://github.com/apache/spark/pull/22816#discussion_r228012237 --- Diff: core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala --- @@ -114,7 +114,7 @@ private[spark] abstract class BasePythonRunner[IN, OUT]( context.addTaskCompletionListener[Unit] { _ => writerThread.shutdownOnTaskCompletion() - if (!reuseWorker || !released.get) { + if (!reuseWorker || released.compareAndSet(false, true)) { --- End diff -- I think `released` variable here indices if `releasePythonWorker` is actually called or not before. Shall we rename and update the comments at `val released`?
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org