uvloop icon indicating copy to clipboard operation
uvloop copied to clipboard

Fatal error on transport TCPTransport (error status in uv_stream_t.shutdown callback)

Open lgrahl opened this issue 6 years ago • 6 comments

  • uvloop version: 0.12.2
  • Python version: 3.7.1
  • Platform: Ubuntu 18.04.2 LTS

We're encountering the following fatal error on a daily basis on our production server using @aaugustin's WebSocket implementation:

Fatal error on transport TCPTransport (error status in uv_stream_t.shutdown callback)
protocol: <websockets.server.WebSocketServerProtocol object at 0x7fc1a3bd8f98>
transport: <TCPTransport closed=False reading=False 0x1cc72c8>
OSError: [Errno 107] Transport endpoint is not connected

Apparently this happens when reading using a subclassed asnycio.StreamReader since the websockets library subsequently raises a ConnectionClosed error in its recv function.

Unfortunately, I was not able to reproduce this locally and I honestly don't really know where to look either.

lgrahl avatar Apr 08 '19 11:04 lgrahl

I'm also getting that error + I'm using the same websocket library (and python 3.7.3 on alpine linux)

bsergean avatar Aug 23 '19 17:08 bsergean

This may have been solved by https://github.com/MagicStack/uvloop/commit/ef29dab2c80e7d5497f288deb7a817b873a188ab could you give uvloop 0.13.0 a spin a report back?

jlaine avatar Aug 24 '19 08:08 jlaine

Looks like the problem is gone (I also switched to python 3.7.4 btw). Thanks for the hint @jlaine !

bsergean avatar Aug 24 '19 22:08 bsergean

@lgrahl as it's your issue could you give it a go and report back?

jlaine avatar Aug 25 '19 08:08 jlaine

I'm having the same/similar issue using 0.13.0 with streaming protocol (TCP):

protocol: <loader_comms.AsyncLoaderServiceProtocol object at 0x7f63564f1a58>
transport: <TCPTransport closed=False reading=False 0x17f0da8>
Traceback (most recent call last):
  File "uvloop/handles/stream.pyx", line 769, in uvloop.loop.__uv_stream_on_read_common
  File "uvloop/handles/stream.pyx", line 615, in uvloop.loop.UVStream._on_eof
  File "/usr/lib/python3.5/asyncio/protocols.py", line 94, in eof_received
    def eof_received(self):
  File "./iteration_manager.py", line 267, in sig_handler
    sys.exit(0)
SystemExit: 0

Attempted same shutdown with base asyncio; issue not present there. Thank you for looking at this.

Prideauxx avatar Sep 06 '19 20:09 Prideauxx

Have you tried with python 3.7 ?

bsergean avatar Sep 06 '19 20:09 bsergean

Closing for now, please feel free to reply/open a new issue.

fantix avatar Sep 09 '22 14:09 fantix