-
Notifications
You must be signed in to change notification settings - Fork 3k
DNS send returning WOULD_BLOCK forces delayed retry #9900
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 send returning WOULD_BLOCK forces delayed retry #9900
Conversation
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.
No printf() should be left there.
I know there is a direct printf call in the code, but before we merge this we should test this against a platform, which actually returns WOULD_BLOCK from send and see that DNS still resolves correctly. |
@michalpasztamobica, thank you for your changes. |
I guess mbed-trace would be the way to go here instead of printf. |
I hate traces on normal behaviour, so I'm fine without those. |
@VeijoPesonen , @SeppoTakalo . I plan to remove that printf, but I need to see it trigger and not crash anything ;-). @AriParkkila , please provide us with an information on which platforms will make use of this (if in doubt - this PR is to follow internal ticket ONME-4181) |
Breakage on master fix, restarted the job |
Reviews please here! |
0cec313
to
967cd31
Compare
features/netsocket/nsapi_dns.cpp
Outdated
@@ -30,6 +30,9 @@ | |||
#include "PlatformMutex.h" | |||
#include "SingletonPtr.h" | |||
|
|||
#define TRACE_GROUP "DNS_API" |
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.
Trace group name should be max 4 characters long
features/netsocket/nsapi_dns.cpp
Outdated
@@ -1021,7 +1024,15 @@ static void nsapi_dns_query_async_send(void *ptr) | |||
err = query->socket->sendto(dns_addr, packet, len); | |||
|
|||
if (err < 0) { | |||
query->dns_server++; | |||
if (err == NSAPI_ERROR_WOULD_BLOCK) { | |||
tr_debug("NSAPI_ERROR_WOULD_BLOCK in nsapi_dns_query_async_send\n"); |
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.
Is this really needed actually.
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.
In other words, either remove the trace print or fix the trace group name.
967cd31
to
ee056da
Compare
@0xc0170 , I removed the debug print entirely, as @VeijoPesonen requested. Could you please restart the CI? |
Will be scheduled once rc2 is generated (few PRs in CI) |
starting CI as CI resources are available |
Test run: SUCCESSSummary: 13 of 13 test jobs passed |
Description
In case send returns a WOULD_BLOCK error, we should not retry imediatelly but wait some time.
Pull request type
Reviewers
@SeppoTakalo
@AriParkkila