[
https://issues.apache.org/jira/browse/SPARK-38659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18069377#comment-18069377
]
Siddhartha Bagaria commented on SPARK-38659:
--------------------------------------------
Seems to be resolved by
[https://github.com/apache/spark/commit/ef83255e4749b76d56c77764e85b223f26a668d1.]
It should be included in pyspark 4.2.0.
> PySpark ResourceWarning: unclosed socket
> ----------------------------------------
>
> Key: SPARK-38659
> URL: https://issues.apache.org/jira/browse/SPARK-38659
> Project: Spark
> Issue Type: Bug
> Components: PySpark
> Affects Versions: 3.2.1
> Reporter: Gergely Kalmar
> Priority: Minor
>
> Create a file called `spark.py` with the following contents:
> ```
> from pyspark.sql import SparkSession
> with SparkSession.builder.getOrCreate() as spark:
> spark.read.csv('test.csv').collect()
> ```
> You can also create a `test.csv` file with whatever data in it. When
> executing `python -Wall spark.py` I get the following warning:
> ```
> /usr/lib/python3.8/socket.py:740: ResourceWarning: unclosed <socket.socket
> fd=7, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6,
> laddr=('127.0.0.1', 51344), raddr=('127.0.0.1', 39221)>
> self._sock = None
> ResourceWarning: Enable tracemalloc to get the object allocation traceback
> ```
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]