-
Notifications
You must be signed in to change notification settings - Fork 328
[WIP][Greendns] Replace deprecated resolver.query by resolver.resolve #840
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
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #840 +/- ##
=======================================
- Coverage 53% 23% -31%
=======================================
Files 88 88
Lines 9848 9983 +135
Branches 1841 1811 -30
=======================================
- Hits 5299 2317 -2982
- Misses 4164 7480 +3316
+ Partials 385 186 -199
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
759f76f
to
e5c5d2c
Compare
7cdedd0
to
ec88ef2
Compare
ec88ef2
to
a6a0f1b
Compare
This topic seems a bit more complicated than just replacing a deprecated method by a new one.
I need further investigation to see what happens. The latest build is successful because I submitted a new patch set with an empty commit, just to compare... @blink1073: Please can you give us more details on the way you made your tests and how you triggered this warning? |
Moving to the new function lead eventlet to: > raise NoNameservers(request=self.request, errors=self.errors)
E dns.resolver.NoNameservers: All nameservers failed to answer the query machine. IN A: |
a6a0f1b
to
ad06bec
Compare
Here's the full traceback from pymongo:
Our code that uses dnspython directly is here. We test eventlet integration by applying this patch and then invoking |
Usages of `resolver.query` are deprecated[1][2][3] and should be replaced by `resolver.resolve`. Fix eventlet#818 [1] https://dnspython.readthedocs.io/en/latest/whatsnew.html#id8 [2] https://github.com/rthalley/dnspython/blob/adfc942725bd36d28ec53f7e5480ace9eb543bd8/dns/resolver.py#L1360 [3] https://github.com/rthalley/dnspython/blob/adfc942725bd36d28ec53f7e5480ace9eb543bd8/dns/resolver.py#L1596
ad06bec
to
7243eeb
Compare
Thanks for the details. Unit tests should be fixed too, I need to rework my patch. |
@@ -400,7 +400,8 @@ def end(): | |||
return end() | |||
|
|||
# Main query | |||
step(self._resolver.query, qname, rdtype, rdclass, tcp, source, raise_on_no_answer=False) | |||
step(self._resolver.resolve, qname, rdtype, rdclass, tcp, source, | |||
raise_on_no_answer=False, search=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolve
and query
doesn't have the same signature, and internally query
call resolve
with search=True
, while this option is set to None
by default.
Usages of
resolver.query
are deprecated[1][2][3] and should be replaced byresolver.resolve
.Fix #818
[1] https://dnspython.readthedocs.io/en/latest/whatsnew.html#id8
[2] https://github.com/rthalley/dnspython/blob/adfc942725bd36d28ec53f7e5480ace9eb543bd8/dns/resolver.py#L1360
[3] https://github.com/rthalley/dnspython/blob/adfc942725bd36d28ec53f7e5480ace9eb543bd8/dns/resolver.py#L1596