spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antony Mayi (JIRA)" <>
Subject [jira] [Created] (SPARK-12617) socket descriptor leak killing streaming app
Date Mon, 04 Jan 2016 09:02:39 GMT
Antony Mayi created SPARK-12617:

             Summary: socket descriptor leak killing streaming app
                 Key: SPARK-12617
             Project: Spark
          Issue Type: Bug
          Components: PySpark, Streaming
    Affects Versions: 1.5.2
         Environment: pyspark (python 2.6)
            Reporter: Antony Mayi
            Priority: Critical

There is a socket descriptor leakage in a pyspark streaming app when configured with batch
interval slightly more then 30 seconds. This is due to default timeout py4j JavaGateway which
(half) closes CallbackConnection after 30 seconds of inactivity and creates new one next time.
That connection don't get closed on the python CallbackServer side and keep piling up until
it eventually blocks new connections.

h2. Steps to reproduce:
* Submit attached [^] to spark
* Watch {{/tmp/bug.log}} to see the increasing total number of py4j callback connections of
which 0 will ever be closed
[BUG] py4j callback server port: 51282
[BUG] py4j CB 0/0 closed
[BUG] py4j CB 0/123 closed
* You can confirm the reality by using lsof on the pyspark driver process:
$ sudo lsof -p 39770 | grep CLOSE_WAIT | grep :51282
python2.6 39770  das   94u  IPv4 138824906      0t0       TCP localhost.localdomain:51282->localhost.localdomain:60419
python2.6 39770  das   95u  IPv4 138867747      0t0       TCP localhost.localdomain:51282->localhost.localdomain:60745
python2.6 39770  das   96u  IPv4 138831829      0t0       TCP localhost.localdomain:51282->localhost.localdomain:32849
python2.6 39770  das   97u  IPv4 138890524      0t0       TCP localhost.localdomain:51282->localhost.localdomain:33184
python2.6 39770  das   98u  IPv4 138860190      0t0       TCP localhost.localdomain:51282->localhost.localdomain:33512
python2.6 39770  das   99u  IPv4 138860439      0t0       TCP localhost.localdomain:51282->localhost.localdomain:33854
* If you leave it running for long enough the CallbackServer will eventually become unable
to accept new connections from the gateway and the app will crash:
16/01/02 05:12:07 ERROR scheduler.JobScheduler: Error generating jobs for time 1451711400000
py4j.Py4JException: Error while obtaining a new communication channel
Caused by: Connection timed out
        at Method)
        at py4j.CallbackConnection.start(

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message