Skip to content

Fix EOF for buffered app protocol#177

Merged
1st1 merged 1 commit into
MagicStack:masterfrom
fantix:buffered_eof
Jul 4, 2018
Merged

Fix EOF for buffered app protocol#177
1st1 merged 1 commit into
MagicStack:masterfrom
fantix:buffered_eof

Conversation

@fantix

@fantix fantix commented Jul 3, 2018

Copy link
Copy Markdown
Member

UV_EOF is given to read_cb() on EOF, which causes an error like this:

Unexpected calls to loop.call_exception_handler():
[{'exception': RuntimeError('no python buffer is allocated in on_read; nread=-4095',),
  'message': 'Fatal error on transport UnixTransport',
  'protocol': <uvloop.loop.SSLProtocol object at 0x7f1749684630>,
  'transport': <UnixTransport closed=True reading=False 0x7f17496eb6c8>},
 {'exception': RuntimeError('no python buffer is allocated in on_read; nread=-4095',),
  'message': 'Fatal error on transport UnixTransport',
  'protocol': <uvloop.loop.SSLProtocol object at 0x7f1749650470>,
  'transport': <UnixTransport closed=True reading=False 0x7f1749643a08>}]
FAIL

======================================================================
FAIL: test_create_unix_connection_ssl_1 (tests.test_unix.Test_UV_UnixSSL)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/decentfox/uvloop/uvloop/_testbase.py", line 102, in tearDown
    self.fail('unexpected calls to loop.call_exception_handler()')
AssertionError: unexpected calls to loop.call_exception_handler()

This failing test was found in #176, but it was unstable. Let me try to make a stable test for this fix.

Related upstream issue: joyent/libuv#803

@fantix

fantix commented Jul 4, 2018

Copy link
Copy Markdown
Member Author

Added test - took some time to figure out how to reproduce the "EPOLLHUP with data" scenario. Now the test is stably failing without the fix.

@1st1 1st1 merged commit f9c4393 into MagicStack:master Jul 4, 2018
@1st1

1st1 commented Jul 4, 2018

Copy link
Copy Markdown
Member

Awesome, thanks!

@fantix fantix deleted the buffered_eof branch July 5, 2018 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants