Skip to content
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

Resolve runs for longer than lifetime #913

Closed
nmenardg-keeper opened this issue Mar 20, 2023 · 2 comments
Closed

Resolve runs for longer than lifetime #913

nmenardg-keeper opened this issue Mar 20, 2023 · 2 comments

Comments

@nmenardg-keeper
Copy link

Describe the bug
Using the email-validator lib ( https://github.com/JoshData/python-email-validator/blob/main/email_validator/deliverability.py#L40 ), with a lifetime set to 15s, resolve often runs for over 60 seconds. I'd expect a lifetime of 15s to run for maybe 16s maximum. I didn't test further, my solution on my side is to to use signal to interrupt the resolve (got the idea from https://stackoverflow.com/a/494273 )
I also opened an issue on email-validator: JoshData/python-email-validator#101

To Reproduce
See email-validator implementation. You could try maybe throttling network calls

Context (please complete the following information):

  • dnspython version 2.3.0
  • Python version 3.8
  • OS: Linux (can't disclose specific distro)
@rthalley
Copy link
Owner

Is it your validate_email_delivery() that is taking more than 60 seconds, or a single call to resolve()? The resolver's lifetime field is the default lifetime for each resolve() invocation. Your validate_email_delivery() code is calling resolve() several times, to get MX, A, AAAA, and TXT. At 15 seconds each, that could be 60 seconds. If you want to impose a lifetime over a set of resolutions, you need to decide how much to give each and supply a lifetime for each invocation.

@nmenardg-keeper
Copy link
Author

That's a very good point. I'm not working on that lib so I won't debug more closely, but I'll close this ticket

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

No branches or pull requests

2 participants