New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not write on a closed transport #58

Merged
merged 2 commits into from Jun 11, 2018

Conversation

2 participants
@yohanboniface
Member

yohanboniface commented Jun 10, 2018

Open questions:

  • should we try to write and catch RuntimeError instead?
  • should we log? (but we don't have any logger yet nor logger configuration, see next point)
  • should we call on_error (but write is not yet async so it cannot call hooks yet)

See also:

Traceback:

Jun 10 03:12:50 scw-8f883c Trefle[6872]: Exception in callback <bound method HTTPProtocol.write of <roll.HTTPProtocol object at 0x7fce04d2f6c8>>
Jun 10 03:12:50 scw-8f883c Trefle[6872]: handle: <Handle HTTPProtocol.write>
Jun 10 03:12:50 scw-8f883c Trefle[6872]: Traceback (most recent call last):
Jun 10 03:12:50 scw-8f883c Trefle[6872]:   File "uvloop/cbhandles.pyx", line 64, in uvloop.loop.Handle._run
Jun 10 03:12:50 scw-8f883c Trefle[6872]:   File "/srv/trefle/venv/lib/python3.6/site-packages/roll/__init__.py", line 522, in write
Jun 10 03:12:50 scw-8f883c Trefle[6872]:     self.transport.write(payload)
Jun 10 03:12:50 scw-8f883c Trefle[6872]:   File "uvloop/handles/stream.pyx", line 636, in uvloop.loop.UVStream.write
Jun 10 03:12:50 scw-8f883c Trefle[6872]:   File "uvloop/handles/handle.pyx", line 165, in uvloop.loop.UVHandle._ensure_alive
Jun 10 03:12:50 scw-8f883c Trefle[6872]: RuntimeError: unable to perform operation on <UnixTransport closed=True reading=False 0x7fce04d09048>; the handler is closed

@yohanboniface yohanboniface requested review from trollfot and davidbgk Jun 10, 2018

Also catch RuntimeError when writting on transport
In case it is closed during the write operation.

@yohanboniface yohanboniface merged commit e26a493 into master Jun 11, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@yohanboniface yohanboniface deleted the isclosed branch Jun 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment