Closed relu91 closed 2 years ago
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
lib/agent.ts | 11 | 14 | 78.57% | ||
<!-- | Total: | 11 | 14 | 78.57% | --> |
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
lib/agent.ts | 1 | 83.18% | ||
<!-- | Total: | 1 | --> |
Totals | |
---|---|
Change from base Build 1739754569: | -0.2% |
Covered Lines: | 1142 |
Relevant Lines: | 1258 |
Hello, this is my first PR to this repository let me know if I have to change the commit style or if I skipped some steps. Regarding the PR I'm coming from https://github.com/eclipse/thingweb.node-wot/issues/637 where we found that node hanged after using coap client. I've dug into the code and I found out that the problem arises when you close an
agent
when there are no pending requests running. Basically if you take a look at the current implementation code:The abort function is never called which in the end has the effect of not properly closing the socket. Net result? node hangs and does not exit.
This PR fix this shortcoming and a couple of other details:
done
function is only called after the socket is really closedWarning after a clean clone on windows with node 14.17.0 I have a couple of tests that are still failing, this PR does not fix those.