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

Trouble with query_missing_srv() #156

Closed
lyager opened this issue Dec 19, 2023 · 5 comments
Closed

Trouble with query_missing_srv() #156

lyager opened this issue Dec 19, 2023 · 5 comments

Comments

@lyager
Copy link
Contributor

lyager commented Dec 19, 2023

I've experienced some trouble in the latest release with the above function, and just wondering if additional querying of SRV entries are within spec?

What happens is that the SRV query within the function above is very aggressive, and if a SRV never comes it will spam the network.

There should probably be a stopping mechanism if no answer hits the cache?

@keepsimple1
Copy link
Owner

keepsimple1 commented Dec 19, 2023

I've experienced some trouble in the latest release with the above function, and just wondering if additional querying of SRV entries are within spec?

May I ask what kind of trouble? (never mind, I think you mentioned that in the next paragraph.) More details will be helpful for fixing this issue.

The spec says a service should send SRV records along with PTR records. But in reality some service don't do that. Hence this function was added. I cannot find spec forbidding such queries. Let me know if I missed some part of the spec.

What happens is that the SRV query within the function above is very aggressive, and if a SRV never comes it will spam the network.

One thing I'd like to do is to limit such query only for the domains being queried, something like the refreshing logic:

for (ty_domain, _sender) in zc.queriers.iter() {

This will avoid querying random services on the network and reduce potential security issues. We can also adjust the wait time before querying.

There should probably be a stopping mechanism if no answer hits the cache?

We can limit the number of such queries for a given service, say up to twice.

@keepsimple1
Copy link
Owner

I've opened a PR to solve this issue. If possible, please let me know if the patch would work for you. Thanks!

@lyager
Copy link
Contributor Author

lyager commented Dec 20, 2023

Sorry for the rather short reporting. I think querying for SRV is fine. But your observation is correct, it might not be fruitful to do so when it's not within the TY that we're browsing for.

Also, what if the device that fails to initially send a SRV response never does?

I wont be able to properly test the PR this year, due to being out of office, but I'm pretty sure that the PR is a good shot, and what is expected of the package.

@keepsimple1
Copy link
Owner

Sorry for the rather short reporting. I think querying for SRV is fine. But your observation is correct, it might not be fruitful to do so when it's not within the TY that we're browsing for.

no problem.

Also, what if the device that fails to initially send a SRV response never does?

With the PR, we will stop querying for SRV after two attempts, and the service instance will not be resolved.

I wont be able to properly test the PR this year, due to being out of office, but I'm pretty sure that the PR is a good shot, and what is expected of the package.

Thanks for reviewing the PR. No problem, I will also try to add a test case.

@keepsimple1
Copy link
Owner

refactored the patch and did manual tests. Merged the patch. Take it for a spin when you have time in new year ;-)

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