Skip to content
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

Lazy socket unable to reconnect on abruptly terminated connections on Node 16 #3

Closed
jonathansamines opened this issue Jul 5, 2022 · 0 comments

Comments

@jonathansamines
Copy link

Hello, reporting an issue here:

Context
We indirectly depend on this package through the graphite package. As of Node 15.0.0, the client is unable to reconnect on abrupt terminations by the graphite server.

Reproduction
Fortunately, no reproduction is necessary. An existing test fails in both Node 15.0.0 and 16.0.0:

node:assert:399
    throw err;
    ^

AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:

  assert.ok(!err)

    at /Users/jsamines/dev/personal/node-lazy-socket/test/integration/test-connection-interrupt.js:49:12
    at cbProxy (/Users/jsamines/dev/personal/node-lazy-socket/lib/LazySocket.js:37:17)
    at processTicksAndRejections (node:internal/process/task_queues:82:21) {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: false,
  expected: true,
  operator: '=='
}

Suggested solution
Node 15 includes a number of semver-major changes to both the stream and net packages, but I suspect nodejs/node#31806 is the one causing issues here, as the error event is no longer emitted when the socket is abruptly terminated by the server. Adding an end handler seems to fix the issue, though I am not certain is the correct solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant