[
https://issues.apache.org/jira/browse/SPARK-54929?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Hyukjin Kwon resolved SPARK-54929.
----------------------------------
Fix Version/s: 4.2.0
Resolution: Fixed
Issue resolved by pull request 53707
[https://github.com/apache/spark/pull/53707]
> taskContext._resources reset in loop causes only last resource to be kept
> -------------------------------------------------------------------------
>
> Key: SPARK-54929
> URL: https://issues.apache.org/jira/browse/SPARK-54929
> Project: Spark
> Issue Type: Bug
> Components: PySpark
> Affects Versions: 4.1.0
> Reporter: Yicong Huang
> Assignee: Yicong Huang
> Priority: Major
> Labels: pull-request-available
> Fix For: 4.2.0
>
>
> In {{worker.py}}, {{taskContext._resources}} is reset inside the for loop, so
> only the last resource is kept when multiple resources exist.
> {code:python}
> taskContext._resources = {}
> for r in range(read_int(infile)):
> key = utf8_deserializer.loads(infile)
> name = utf8_deserializer.loads(infile)
> addresses = []
> taskContext._resources = {} # should be removed
> for a in range(read_int(infile)):
> addresses.append(utf8_deserializer.loads(infile))
> taskContext._resources[key] = ResourceInformation(name, addresses)
> {code}
> This was introduced in SPARK-28234 (2019). Existing tests only cover
> single-resource case so the bug was not caught.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]