Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion python/pyspark/rdd.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ def _parse_memory(s):


def _load_from_socket(sock_info, serializer):
(sockfile, sock) = local_connect_and_auth(*sock_info)
port = sock_info[0]
auth_secret = sock_info[1]
(sockfile, sock) = local_connect_and_auth(port, auth_secret)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was correctly ported back at #25593. There's no such code you pointed out in Spark 2.4.4: https://github.com/apache/spark/blob/v2.4.4/python/pyspark/sql/dataframe.py#L2182.

Are you using your own fork or mixing the Spark versions? Your error message seems from https://github.com/apache/spark/blob/v2.4.3/python/pyspark/sql/dataframe.py#L2179 which is Spark 2.4.3. Spark 2.4.3 does not have this change.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HyukjinKwon You are linking to dataframe.py but I patched rdd.py
The code is there:
https://github.com/apache/spark/blob/v2.4.4/python/pyspark/rdd.py#L144

So (*sock_info) is used instead of passing individual touple values.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I see now. It is possible that that I messed something while using pipenv.
Anyway I feel that using (*sock_info) is inherently unsafe and prone to such errors.

Copy link
Member

@HyukjinKwon HyukjinKwon Jul 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I actually already pointed it out it's error-prone in the previous PR. Feel free to open another PR to fix it.

# The RDD materialization time is unpredicable, if we set a timeout for socket reading
# operation, it will very possibly fail. See SPARK-18281.
sock.settimeout(None)
Expand Down