Skip to content

PYTHON-2362 Test with dnspython<2.0 to avoid timeouts #484

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
Sep 11, 2020

Conversation

ShaneHarvey
Copy link
Member

There seems to be a bug in dnspython 2.0 related to SRV lookups. For now we should downgrade to dnspython<2.0 to get the test suite green.

@ShaneHarvey ShaneHarvey changed the title PYTHON-2362 Use dnspython<2.0 to avoid timeouts PYTHON-2362 Test with dnspython<2.0 to avoid timeouts Sep 10, 2020
if $PYTHON -c 'import dns'; then
# Trying with/without --user to avoid:
# ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv.
$PYTHON -m pip install --upgrade --user 'dnspython<2.0.0' || $PYTHON -m pip install --upgrade 'dnspython<2.0.0'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not always install without --user?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because then we might need sudo. This will just be a temporary workaround until the toolchain is updated.

Copy link
Contributor

@prashantmital prashantmital left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we cut a 3.11.1 release that pins DNSPython to <2 so that new installs of PyMongo can still talk to Atlas? This seems like a massive issue...

@behackett
Copy link
Member

The problem is with Eventlet, right? Probably why no one has complained.

@ShaneHarvey
Copy link
Member Author

Yes this is an eventlet problem. dnspython 2.0 works fine up until eventlet is imported:

>>> from dns import resolver
>>> resolver.query('_mongodb._tcp.test5.test.build.10gen.cc', 'SRV', lifetime=5)
<stdin>:1: DeprecationWarning: please use dns.resolver.resolve() instead
<dns.resolver.Answer object at 0x7fb575599940>
>>> import eventlet
>>> resolver.query('_mongodb._tcp.test5.test.build.10gen.cc', 'SRV', lifetime=5)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ubuntu/venv/lib/python3.8/site-packages/dns/resolver.py", line 1221, in query
    return resolve(qname, rdtype, rdclass, tcp, source,
  File "/home/ubuntu/venv/lib/python3.8/site-packages/dns/resolver.py", line 1205, in resolve
    return get_default_resolver().resolve(qname, rdtype, rdclass, tcp, source,
  File "/home/ubuntu/venv/lib/python3.8/site-packages/dns/resolver.py", line 1043, in resolve
    timeout = self._compute_timeout(start, lifetime)
  File "/home/ubuntu/venv/lib/python3.8/site-packages/dns/resolver.py", line 950, in _compute_timeout
    raise Timeout(timeout=duration)
dns.exception.Timeout: The DNS operation timed out after 5.10618257522583 seconds

This should be fixed by eventlet: eventlet/eventlet#619.

@ShaneHarvey
Copy link
Member Author

Should we cut a 3.11.1 release that pins DNSPython to <2 so that new installs of PyMongo can still talk to Atlas? This seems like a massive issue...

I don't think this is a massive issue and I'm not sure we should do anything else. eventlet>=0.26.1 was released which pins to dnspython<2.0 and pymongo already specifies dnspython<2.0 here:

    extras_require.update({'srv': ["dnspython>=1.16.0,<2.0.0"]})

@ShaneHarvey ShaneHarvey merged commit c549740 into mongodb:master Sep 11, 2020
@ShaneHarvey ShaneHarvey deleted the PYTHON-2362 branch September 14, 2020 18:44
ShaneHarvey added a commit to ShaneHarvey/mongo-python-driver that referenced this pull request Oct 13, 2020
ShaneHarvey added a commit that referenced this pull request Oct 14, 2020
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.

3 participants