question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Client.close raises StreamClosedError

See original GitHub issue

Appears the running Client.close consistently runs into some sort of hang up (shown below). This happens in Distributed 1.21.8, but not in Distributed 1.21.6. Context for this provided in the linked Gist, which contains the Jupyter Notebook it showed up in and the environment.

Exception ignored in: <generator object add_client at 0x11e4d1f10>
RuntimeError: generator ignored GeneratorExit
Future exception was never retrieved
future: <Future finished exception=CommClosedError('in <closed TCP>: Stream is closed',)>
Traceback (most recent call last):
  File "/zopt/conda2/envs/test/lib/python3.6/site-packages/distributed/comm/tcp.py", line 179, in read
    n_frames = yield stream.read_bytes(8)
  File "/zopt/conda2/envs/test/lib/python3.6/site-packages/tornado/gen.py", line 1099, in run
    value = future.result()
tornado.iostream.StreamClosedError: Stream is closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/zopt/conda2/envs/test/lib/python3.6/site-packages/tornado/gen.py", line 1107, in run
    yielded = self.gen.throw(*exc_info)
  File "/zopt/conda2/envs/test/lib/python3.6/site-packages/distributed/comm/tcp.py", line 200, in read
    convert_stream_closed_error(self, e)
  File "/zopt/conda2/envs/test/lib/python3.6/site-packages/distributed/comm/tcp.py", line 128, in convert_stream_closed_error
    raise CommClosedError("in %s: %s" % (obj, exc))
distributed.comm.core.CommClosedError: in <closed TCP>: Stream is closed

ref: https://gist.github.com/jakirkham/b9c75e2f7fabdee5f19db8cc3bff0d9e ref: https://github.com/dask/distributed/issues/1963

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
macks22commented, May 8, 2018

@jakirkham I can see your concern – I definitely don’t want to convolute two issues. However, I think this is the same problem. My example simply uses the context manager for the Client, whose __exit__ just calls Client.close, which is what triggers the exception. This leads me to believe this is the same issue, and hence, that my comment should remain here and not be filed as another issue.

0reactions
zoj613commented, Sep 30, 2022

Im facing this problem with distributed==2022.9.1 and dask. Any workaround I can emply to silence these errors after calling client.gather successfully?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tornado raises StreamClosedError: Stream is closed
I have had same issue. It can occur when you set minsize (for asyncmc.Client) more than 1 and when some connections into ConnectionPool...
Read more >
tornado.iostream 源代码
[文档]class StreamClosedError(IOError): """Exception raised by `IOStream` methods when the stream is closed. Note that the close callback is scheduled to ...
Read more >
rosbridge_server: websocket_handler.py Source File
45 from tornado.iostream import StreamClosedError ... 67 raise. 68 return wrapper ... 138 rospy.logwarn("Client %d did not authenticate. Closing connection.
Read more >
Source code for h2.connection - python-hyper
CLOSED raise ProtocolError( "Invalid input %s in state %s" % (input_, ... When called on a client connection, this method will return a...
Read more >
'Stream is closed' crashing the tornado process - Google Groups
raise IOError("Stream is closed") IOError: Stream is closed. It seems like the flash client is disconnection (on_close()) but then
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found