-
Notifications
You must be signed in to change notification settings - Fork 3k
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
DNS manual cleanup mechanism added #11535
Conversation
* NOTE: Does NOT clear asynchronous ongoing operations! | ||
* Currently only cleans up DNS cache (if used) | ||
*/ | ||
void nsapi_dns_reset(); |
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.
Why is this in the public API?
I don't see any real use cases for resetting the cache, other than to test it.
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.
We don't have, but some application developer might want to use it so why should we prevent that?
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.
The real solution should be that when last NetworkStack is freed, we should free all DNS related stuff as well. Or if permanent DNS cache is needed, we could flag that.
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.
Such automatic purging should be optional. Cached information is still valid even if a network interface goes down.
No objection to adding a public API for test and/or application use though.
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.
Our DNS greentea tests use cache, even though perhaps sometimes they shouldn't. For example, if you run the whole suite, then the _SIMULTANOUS
tests which are supposed to run 5 DNS requests at the same time, will in fact take three addresses resolved in previous tests out of cache and only open two more sockets to resolve the non-cached addresses.
With this API in place we can clear cache where we don't want the test to rely on it.
@AnttiKauppila, thank you for your changes. |
@ARMmbed/mbed-os-maintainers Please proceed |
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.
Changes look good to me.
Please add "Release section"
CI started |
Test run: FAILEDSummary: 3 of 4 test jobs failed Failed test jobs:
|
Added |
I edited the release notes. CI started |
Test run: FAILEDSummary: 3 of 4 test jobs failed Failed test jobs:
|
@AnttiKauppila , I was trying out your branch to check my K64F failures and I got the code to compile by adding
into |
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 did some debugging on top of your PR within dns test suite (for ESP8266 issues) and while doing that I found some improvements in the test code, which I didn't notice earlier...
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, @AnttiKauppila . I am looking forward to having this on master, as this makes things much easier for debugging dns tests 😃
Yes, the tests have initially been made quite badly because those were dependent on previous tests. If someone not knowing that (like me) would have added or modified the tests some other test could have got broken! We should avoid having such test cases |
@ARMmbed/mbed-os-maintainers Could you proceed with this |
CI started |
Test run: FAILEDSummary: 3 of 4 test jobs failed Failed test jobs:
|
Failures look related:
|
@0xc0170 Added the missing include |
CI restarted |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Description
Added a mechanism to clean up DNS cache when not needed.
DNS test cases updated to cleanup cache before running those.
Pull request type
Reviewers
@SeppoTakalo @jamesbeyond @ARMmbed/mbed-os-ipcore
Release Notes
Add
nsapi_dns_reset()
function to be able to clear a DNS cache when it is not needed anymore.