You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Gergely Kalmar (Jira)" <ji...@apache.org> on 2022/03/25 13:12:00 UTC
[jira] [Created] (SPARK-38659) PySpark ResourceWarning: unclosed socket
Gergely Kalmar created SPARK-38659:
--------------------------------------
Summary: 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
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.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org