-
-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: make timeout and lifetime settings of DNS resolver individually…
… configurable. Fixes #1102
- Loading branch information
1 parent
cc07d08
commit 5b6656d
Showing
2 changed files
with
7 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5b6656d
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.
It will be nice to make this configurable via the Configure/Account objects for future releases.
Dividing the dns resolver timeout with a 2.5 factor will allow 2~ nameservers to timeout before going to the third.
Anyway, I think it is better to stick with
dnspython
s default value which is 2.0 seconds. Thus- not setting theAutodiscoverProtocol.TIMEOUT
inself.DNS_RESOLVER_ATTRS
5b6656d
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.
It is also possible not to set any timeout (resolver and lifespan) explicitly, and just use dnspython as is. I didn't read about any specific timeout value stratagies in Autodiscover for Exchange ActiveSync developers.
This way, the python dns module will handle it all.
Thanks for your rapid response.
5b6656d
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.
Thanks for your comments!
I'd like to not clutter the
Configuration
orAccount
objects with these settings. They should not be needed by most users, and it would open up for lots of other config options also going in there.The factor of 2.5 came from the dnspython defaults of 2.0 / 5.0 seconds for the timeout / lifetime settings. In my experience, a 5 second timeout caused too many DNS timeout errors in practice for end users and scripts running 24/7, so I'd like to keep the timeout higher than the default.
If you want to use the default timeout, then remove the
timeout
key fromDNS_RESOLVER_ATTRS
. If you want the default lifetime, then setDNS_RESOLVER_LIFETIME
toNone
.5b6656d
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.
@ecederstrand Got your point, makes sense. Anyway, this change looks much better than the current situation.
Any ETA for the next release?
5b6656d
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.
I'm waiting for feedback on #1090 and will release a new version when that is sorted out.
5b6656d
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.
Version 4.7.5 has now been released.