-
Notifications
You must be signed in to change notification settings - Fork 81
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
Counter client example hangs after execution #637
Comments
@JKRhb do you know more? |
Hmm, when I try to execute
Because of that I am not sure if the error arises from the CoAP library or from the Helper class. Does it terminate when fetching the TD with HTTP instead? In any case, I think the close method will probably help with resolving issues like these :) I added it now to #634. I am still waiting for the merge of one types related PR over at node-coap, once that one is merged the close method will hopefully land soon. |
Thank you for testing @JKRhb, are you in sync with master? we've just merged a PR that should have solved the issue that you're mentioning. |
Oh, yeah, you are right, I rebuilt the project and now I can reproduce the issue :) The issue seems to already occur when the TD is fetched – I commented out everything within the |
Correct. |
Edit: I initially thought I found a solution but it turned out to not actually solve the problem :/ I'll have another look into this... Edit2: It is really odd that the problem only occurs when using CoAP for fetching a TD via the CLI. Using the fetch helper function in other contexts works perfectly fine. Maybe we could replace the fetching protocol in the example with HTTP for now and open another issue for this specific problem? At least on my system, there seems to be another, IPv6 related issue ("Destination Unreachable" according to Wireshark) causing the client to hang during these lines: Does the execution of the client example hang there for you as well? |
In my case the client also hangs if I replace
with
Did you mean that?
In my case the client does not hand. Having said that, I do not have any IPv6 addresses so I cannot tell what would happen if I would... |
I've opened the PR above which fixes the problem 😸 , let's wait for review -> merge -> and release |
@relu91 Can you check if the problem is still present after the merge of coapjs/node-coap#329 and the new node-coap version? :) (Thanks again for the fix btw!) |
Yeah, I was testing it this morning. Good news first: it solves the "hang after fetch" problem. But the example still hangs 😢 . The problem is that node-wot does not usually
Ideas? opinions? |
This would a discussion point for the Scripting API, right? |
yeah, I think we can discuss it there. |
Another question that does come into my mind. "Why" did CoAP not hang in v0.7.x and does hang in v0.8.x. Does it relate again with the "stream" changes ? |
Another option is to consider to have some setting in the |
That's a good question, TBH not sure why, one possible answer:
|
Just tried out the counter example once more and #744 finally fixed it :) Sorry for the all the trouble :/ |
Well done @JKRhb !! |
It seems that there is a resource leak in the counter example. My first impression is that CoAp client does not get properly cleaned up after the interaction with the remote thing. Maybe integrating coapjs/node-coap#317 would help to solve the problem.
How to reproduce
Run
node packages/cli/dist/cli.js examples/scripts/counter.js
and in another shellnode packages/cli/dist/cli.js -c examples/scripts/counter-client.js
. The client application hangs without properly exiting.The text was updated successfully, but these errors were encountered: