Github user davies commented on a diff in the pull request:
https://github.com/apache/spark/pull/4601#discussion_r24801227
--- Diff: core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala
---
@@ -144,11 +144,24 @@ private[spark] class PythonRDD(
stream.readFully(update)
accumulator += Collections.singletonList(update)
}
+
// Check whether the worker is ready to be re-used.
- if (stream.readInt() == SpecialLengths.END_OF_STREAM) {
- if (reuse_worker) {
- env.releasePythonWorker(pythonExec, envVars.toMap,
worker)
- released = true
+ if (reuse_worker) {
+ // It has a high possibility that the ending mark is
already available,
+ // And current task should not be blocked by checking it
+
+ if (stream.available() >= 4) {
--- End diff --
@JoshRosen This does not work very well in practice, it's common to see
some workers can not be re-used, I will try to find a better solution, or
revert this? (because it seems that it did not solve the freeze problem).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]