question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Leshan client doesn't send response to bootstrap finish message in all cases (race condition)

See original GitHub issue

There’s currently a race condition in the Leshan client related to bootstrapping. In some cases, bootstrapping fails from the server’s perspective with BootstrapFailureCause.SEND_FINISH_FAILED. The server doesn’t receive a reply to the bootstrap finish message.

The easiest way to explain the issue is to show the code: https://github.com/eclipse/leshan/blob/fbc01b848043cd4c8605bbd1d566728026300bbd/leshan-client-core/src/main/java/org/eclipse/leshan/client/servers/BootstrapHandler.java#L50-L64

The latch gets released before the response is sent to the server.

I’d assume that the fix would be to release the latch after the response has been sent in BootstrapResource class (assuming exchange.respond is synchronous): https://github.com/eclipse/leshan/blob/fbc01b848043cd4c8605bbd1d566728026300bbd/leshan-client-cf/src/main/java/org/eclipse/leshan/client/californium/impl/BootstrapResource.java#L42-L50

the race condition currently (in 1.0.0-M9) happens when the endpoint gets destroyed after bootstrapping finishes from the clients perspective: https://github.com/eclipse/leshan/blob/fbc01b848043cd4c8605bbd1d566728026300bbd/leshan-client-cf/src/main/java/org/eclipse/leshan/client/californium/impl/CaliforniumEndpointsManager.java#L65-L70

that gets called from https://github.com/eclipse/leshan/blob/fbc01b848043cd4c8605bbd1d566728026300bbd/leshan-client-core/src/main/java/org/eclipse/leshan/client/servers/RegistrationEngine.java#L175-L180

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
lhotaricommented, Nov 7, 2018

Thank you @sbernard31 . I’m sorry I missed your previous requests for feedback. I’ll let you know if there is any issues in the solution. I believe it’s all ok, but I’ll get it verified tomorrow

1reaction
sbernard31commented, Oct 9, 2018

That’s what I currently implement, I provide a PR soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Eclipse Leshan LwM2M Build Failure - Stack Overflow
I am currently getting myself into the LwM2M topic and I tried the leshan project from eclipse. I followed the README.md on ...
Read more >
Untitled
Banmat matbaa, Office 2007 setup file location, South african sunset images, Power rangers megazord review, All mp's email addresses, Fear factor india ...
Read more >
ecprice › Public › wordlist.ranked – MIT
... couple va giving chance vision ball ending clients actions listen discuss ... anywhere psychology wet atlantic responses circumstances continues edward ...
Read more >
Secure LwM2M IoT streaming data pipelines in Hospworks ...
In this thesis, IoT Gateway used Leshan to run a LwM2M server and IoT Nodes simulator ... handle all Hypertext Transfer Protocol (HTTP)...
Read more >
Untitled
F1 racing november 2014, Mikengreg homeless! Ragini chandran dance, Songs with catchy beats, Dzis tv wp, All my loving films tony palmer, Snail...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found