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
Initial TLS connection failure causes TLS client handler to stop and fail endlessly w/ EBUSY #5781
Comments
I am not seeing exactly like this outcome in my test. So I am using echo-client with TLS enabled, but I do not have any server setup so that the connection will fail. The TLS handshake will fail and the system returns ETIMEDOUT but the client tries to re-connect.
Do you remember how did you got the client to return EBUSY? |
Hi @jukkar The easiest way to reproduce the EBUSY is to build the lwm2m_client sample configured for DTLS for qemu_x86 (in master branch) and connect it to a Leshan demo server (LwM2M) server without setting up any DTLS information: [terminal window #1: run Leshan demo server] [terminal window #2: build / run lwm2m_client for qemu_x86 using DTLS] You should see a series of -16 (EBUSY) errors and then -12 (ENOMEM) once the heap is used. |
Ok, thanks for the steps, I will try to reproduce this. |
any news? |
@mike-scott There has been lot of activity with lwm2m code recently, can you confirm if this is still a valid issue? |
@jukkar I don't think any of the LwM2M changes would affect the ability to tear down and rebuild the TLS connection in the net_app layer. I'll retest and post my findings. |
@jukkar Yep, still an issue. However, I'm reworking the LwM2M engine code flow which includes how net_app_connect() is used. TL;DR: This will be solved (I think) with future patches that enable bootstrap support. |
@mike-scott is this going to happen for 1.12? |
@nashif nope. needed to get 18 more patches upstream to finish Bootstrap support. Let's mark as v1.13. I'm also not sure how this will change w/ the upcoming rewrite for sockets. |
@mike-scott any updates? |
@mike-scott ping |
@nashif Not sure if we want to close this. It won't be addressed using the net-app APIs. I'll deal with it in the socket re-write. |
so 1.14? |
done |
Move to sockets eliminates this bug. |
The TLS startup code looks like this:
net_app_connect() -> start_tls_client() starts the tls_client_handler thead.
IE: the only way to start the TLS client handler thread is a call to net_app_connect.
If the initial TLS connection fails for any reason (connectivity or otherwise), the TLS client handler is stopped, and using the net_app_connect() call again generates errors as the thread isn't cleared up correctly.
Further, I'm not sure if this is the API flow that we want sample apps to use for making sure TLS comes up correctly. There isn't much in the way of documentation in this area.
The text was updated successfully, but these errors were encountered: