Skip to content

gcoap server breaks or becomes very unresponsive (sock_async related?) #14034

Description

@MichelRottleuthner

Description

I'm having trouble with gcoap becoming completely unresponsive/unreliable in my application.
Up to the point where it doesn't reply to any message while the rest of the system (like shell, interrupts, other drivers etc.) seems to work fine.
First it was hard to reproduce as the node (an ESP32 in this case) just randomly didn't respond after some time even without heavy load.

Steps to reproduce the issue

Stressing the node with CoAP packets seems to work fine to reproduce it.
I'm not 100% sure yet if this is caused by the exact same problem that my other application is facing after some minutes or hours of uptime but in both cases the node behaves in the exact same way after it happend.
Terminal 1:

sudo dist/tools/tapsetup/tapsetup -c 1
BOARD=native make -C examples/gcoap clean all term

Maybe a bit overkill but works for me:
Terminal 2:

for i in {1..100}; \
do \
coap-client -m put coap://[riotlladdr%tapbr0]/cli/stats -e 123 &; \
done

Bisecting gave me ea62734 as the first bad commit that reproduces the problem. Maybe @kb2ma and @miri64 got some ideas?

Expected results

It might take some time to run thru the above loop but it works in a reliable fashion.
With git checkout ea62734baf25a678fa72da40351bf26dae2822e4~1 it does exactly that with no problem at all. Even with the above loop running to 10000 everything worked fine for me.

Actual results

On master the "done" outputs of the individual coap-client executions slows down at some point (the RIOT node gives some "gnrc_sock: dropped message to 0x5659bff0 (was full)" messages, and after it settled a bit, nothing happens anymore. I.e.: there are no COAP replies to the host anymore.
One could argue "yeah, heavy overload situation, unresponsiveness can be expected".
The real problem is that it never seems to recover from that.
Even after minutes of waiting, a manual coap-client -m get coap://[riotlladdr%tapbr0]/cli/stats/cli/stats isn't successful.

Versions

Happens with my native toolchain as well as with BUILD_IN_DOCKER=1.

Metadata

Metadata

Assignees

Labels

Area: CoAPArea: Constrained Application Protocol implementationsType: bugThe issue reports a bug / The PR fixes a bug (including spelling errors)

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions