Skip to content
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

TLS enabled causes tornado FD error #237

Open
HaoweiCh opened this issue Jul 19, 2019 · 0 comments
Open

TLS enabled causes tornado FD error #237

HaoweiCh opened this issue Jul 19, 2019 · 0 comments
Labels

Comments

@HaoweiCh
Copy link

ERROR:tornado.application:Exception in callback functools.partial(<function wrap.<locals>.null_wrapper at 0x10651e0d0>)
Traceback (most recent call last):
  File "/Users/c/.pyenv/versions/script/lib/python3.7/site-packages/tornado/ioloop.py", line 605, in _run_callback
    ret = callback()
  File "/Users/c/.pyenv/versions/script/lib/python3.7/site-packages/tornado/stack_context.py", line 277, in null_wrapper
    return fn(*args, **kwargs)
  File "/Users/c/.pyenv/versions/script/lib/python3.7/site-packages/tornado/iostream.py", line 575, in wrapper
    self._maybe_add_error_listener()
  File "/Users/c/.pyenv/versions/script/lib/python3.7/site-packages/tornado/iostream.py", line 941, in _maybe_add_error_listener
    self._add_io_state(ioloop.IOLoop.READ)
  File "/Users/c/.pyenv/versions/script/lib/python3.7/site-packages/tornado/iostream.py", line 974, in _add_io_state
    self.io_loop.update_handler(self.fileno(), self._state)
  File "/Users/c/.pyenv/versions/script/lib/python3.7/site-packages/tornado/ioloop.py", line 732, in update_handler
    self._impl.modify(fd, events | self.ERROR)
  File "/Users/c/.pyenv/versions/script/lib/python3.7/site-packages/tornado/platform/kqueue.py", line 45, in modify
    self.unregister(fd)
  File "/Users/c/.pyenv/versions/script/lib/python3.7/site-packages/tornado/platform/kqueue.py", line 49, in unregister
    events = self._active.pop(fd)
KeyError: -1

pynsq==0.8.3
tornado==4.5.3

certifi==2018.8.24
python-snappy

run code here

def handler(message):
    print(message)
    return True


# :param tls_options: dictionary of options to pass to `ssl.wrap_socket()
#         <http://docs.python.org/2/library/ssl.html#ssl.wrap_socket>`_ as
#         ``**kwargs``
r = nsq.Reader(
    message_handler=handler,
    snappy=True,
    tls_v1=True,
    tls_options={
        'cert_reqs': ssl.CERT_NONE,
        # 'ssl_version': ssl.PROTOCOL_TLSv1,
        'certfile': '/tmp/nsqtmp/client.pem',
        'keyfile': '/tmp/nsqtmp/client.key',
        # 'ca_certs': '/tmp/nsqtmp/CAroot.pem',
    },
    nsqd_tcp_addresses=['127.0.0.1:4150'],
    topic='test', channel='default')
nsq.run()
@ploxiln ploxiln changed the title just demo code add tls option, show me error, but can receive message tls enabled causes tornado fd error Jul 31, 2019
@mreiferson mreiferson changed the title tls enabled causes tornado fd error TLS enabled causes tornado FD error Jun 15, 2020
@mreiferson mreiferson added the bug label Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants