Skip to content

PYTHON-2320 Use select instead of poll on Jython #466

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

Merged
merged 1 commit into from
Jul 15, 2020

Conversation

ShaneHarvey
Copy link
Member

@ShaneHarvey ShaneHarvey commented Jul 15, 2020

Jira: https://jira.mongodb.org/browse/PYTHON-2320
Jython poll bug: https://bugs.jython.org/issue2900

Calling poll() on a SSLSocket registered with POLLHUP causes the following AttributeError: 'SSLSocket' object has no attribute 'channel':

  File "pymongo/socket_checker.py", line 57, in select
    res = self._poller.poll(timeout * 1000)
  File "/usr/local/Cellar/jython/2.7.2/libexec/Lib/_socket.py", line 592, in poll
    result = self._handle_poll(partial(self.queue.poll, timeout_in_ns, TimeUnit.NANOSECONDS))
  File "/usr/local/Cellar/jython/2.7.2/libexec/Lib/_socket.py", line 541, in _event_test
    fd, event = self._event_test(notification)
  File "/usr/local/Cellar/jython/2.7.2/libexec/Lib/_socket.py", line 541, in _event_test
    if mask & POLLHUP and (notification.hangup or not notification.sock.channel):
AttributeError: 'SSLSocket' object has no attribute 'channel'

@ShaneHarvey ShaneHarvey merged commit b6bf4f0 into mongodb:master Jul 15, 2020
@ShaneHarvey ShaneHarvey deleted the PYTHON-2320 branch July 15, 2020 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants