xuanyuanking commented on a change in pull request #22962:
[SPARK-25921][PySpark] Fix barrier task run without BarrierTaskContext while
python worker reuse
URL: https://github.com/apache/spark/pull/22962#discussion_r233283645
##########
File path: python/pyspark/taskcontext.py
##########
@@ -147,8 +147,8 @@ def __init__(self):
@classmethod
def _getOrCreate(cls):
"""Internal function to get or create global BarrierTaskContext."""
- if cls._taskContext is None:
- cls._taskContext = BarrierTaskContext()
+ if not isinstance(cls._taskContext, BarrierTaskContext):
+ cls._taskContext = object.__new__(cls)
Review comment:
```
could you add some comments to explain it?
```
@cloud-fan Sorry for the less explain and more comments should be done at
first, will done in follow up PR.
```
Can we get rid of the rewrite all?
we should remove __init__ too
next time please fully describe what's going on in PR description
```
@HyukjinKwon Sorry for the less explain, all these will be done in next
follow up PR, and the new UT.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]