Skip to content

Conversation

@ShaneHarvey
Copy link
Member

@ShaneHarvey ShaneHarvey commented Apr 28, 2021

This change works around the following eventlet bug:

$ python green_framework_test.py eventlet -s test.test_srv_polling.TestSrvPolling.test_addition
...
test_addition (test.test_srv_polling.TestSrvPolling) ... ERROR

======================================================================
ERROR: test_addition (test.test_srv_polling.TestSrvPolling)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/shane/pymongo-pycharm-3.8/lib/python3.8/site-packages/dns/resolver.py", line 212, in __init__
    rrset = response.find_rrset(response.answer, qname,
  File "/Users/shane/pymongo-pycharm-3.8/lib/python3.8/site-packages/dns/message.py", line 341, in find_rrset
    raise KeyError
KeyError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/shane/pymongo-pycharm-3.8/lib/python3.8/site-packages/dns/resolver.py", line 220, in __init__
    crrset = response.find_rrset(response.answer,
  File "/Users/shane/pymongo-pycharm-3.8/lib/python3.8/site-packages/dns/message.py", line 341, in find_rrset
    raise KeyError
KeyError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/shane/git/mongo-python-driver/pymongo/srv_resolver.py", line 58, in get_options
    results = _resolve(self.__fqdn, 'TXT',
  File "/Users/shane/pymongo-pycharm-3.8/lib/python3.8/site-packages/dns/resolver.py", line 1100, in query
    return get_default_resolver().query(qname, rdtype, rdclass, tcp, source,
  File "/Users/shane/pymongo-pycharm-3.8/lib/python3.8/site-packages/dns/resolver.py", line 1003, in query
    answer = Answer(_qname, rdtype, rdclass, response,
  File "/Users/shane/pymongo-pycharm-3.8/lib/python3.8/site-packages/dns/resolver.py", line 232, in __init__
    raise NoAnswer(response=response)
dns.resolver.NoAnswer: The DNS response does not contain an answer to the question: test1.test.build.10gen.cc. IN TXT

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/shane/git/mongo-python-driver/test/test_srv_polling.py", line 165, in test_addition
    self.run_scenario(response, True)
  File "/Users/shane/git/mongo-python-driver/test/test_srv_polling.py", line 153, in run_scenario
    client = MongoClient(self.CONNECTION_STRING)
  File "/Users/shane/git/mongo-python-driver/pymongo/mongo_client.py", line 659, in __init__
    res = uri_parser.parse_uri(
  File "/Users/shane/git/mongo-python-driver/pymongo/uri_parser.py", line 497, in parse_uri
    dns_options = dns_resolver.get_options()
  File "/Users/shane/git/mongo-python-driver/pymongo/srv_resolver.py", line 64, in get_options
    raise ConfigurationError(str(exc))
pymongo.errors.ConfigurationError: The DNS response does not contain an answer to the question: test1.test.build.10gen.cc. IN TXT

@ShaneHarvey ShaneHarvey merged commit acfa7b6 into mongodb:master Apr 28, 2021
ShaneHarvey added a commit that referenced this pull request Apr 28, 2021
@ShaneHarvey
Copy link
Member Author

I've reported the underlying issue to eventlet: eventlet/eventlet#701

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