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

net.js broken in node 8.8 #16484

Closed
felixbrucker opened this issue Oct 25, 2017 · 11 comments
Closed

net.js broken in node 8.8 #16484

felixbrucker opened this issue Oct 25, 2017 · 11 comments
Labels
confirmed-bug Issues with confirmed bugs. net Issues and PRs related to the net subsystem.

Comments

@felixbrucker
Copy link

  • Version: v8.8.0
  • Platform: Linux staging 4.10.0-37-generic #41-Ubuntu SMP Fri Oct 6 20:20:37 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
  • Subsystem: net.js

I do not really have simple code, i noticed the problem while running storjshare-daemon, it happend about every 1-5 minutes:

net.js:401
  const prevWriteQueueSize = this._handle.writeQueueSize;
                                          ^

TypeError: Cannot read property 'writeQueueSize' of null
    at Socket._onTimeout (net.js:401:43)
    at ontimeout (timers.js:471:11)
    at tryOnTimeout (timers.js:306:5)
    at Timer.listOnTimeout (timers.js:266:5)

This error seems to be introduced with the recent commit: a627c5f

@addaleax addaleax added the net Issues and PRs related to the net subsystem. label Oct 25, 2017
@addaleax
Copy link
Member

@apapirovski

@JohanvdWest
Copy link

Got the same. The code does not take into account the fact that the socket could be closed by another error (like the other side closing it).

Needs to check if _handle is valid.

@joyeecheung
Copy link
Member

Refs: #15791

@apapirovski
Copy link
Member

Bah, I thought I went through all the possibilities of _handle getting unset and couldn't find a way that it would in that code. Working on a PR.

@apapirovski apapirovski added the confirmed-bug Issues with confirmed bugs. label Oct 25, 2017
vlukashov pushed a commit to vaadin/license-checker that referenced this issue Oct 25, 2017
with `node_js: stable` Travis is using Node 8.8.0 which has bugs: nodejs/node#16484
vlukashov pushed a commit to vaadin/license-checker that referenced this issue Oct 25, 2017
with `node_js: stable` Travis is using Node 8.8.0 which has bugs: nodejs/node#16484
bkimminich added a commit to juice-shop/juice-shop that referenced this issue Oct 25, 2017
@apapirovski
Copy link
Member

Thanks for reporting @felixbrucker and @JohanvdWest. PR is at #16489

bkimminich added a commit to juice-shop/juice-shop that referenced this issue Oct 25, 2017
bkimminich added a commit to juice-shop/juice-shop that referenced this issue Oct 25, 2017
cjihrig pushed a commit that referenced this issue Oct 25, 2017
This commit handles the case where _onTimeout is called with a
null handle.

Refs: #15791
Fixes: #16484
PR-URL: #16489
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
apapirovski added a commit to apapirovski/node that referenced this issue Oct 25, 2017
This commit handles the case where _onTimeout is called with a
null handle.

Refs: nodejs#15791
Fixes: nodejs#16484
PR-URL: nodejs#16489
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
tulioag pushed a commit to vaadin/license-checker that referenced this issue Oct 26, 2017
* fix the version of NodeJS to avoid random build failures

with `node_js: stable` Travis is using Node 8.8.0 which has bugs: nodejs/node#16484
@depoulo
Copy link

depoulo commented Oct 26, 2017

Can anyone tell me whether I should roll back from v8.8.0 and wait for v8.8.1 do appear on Docker Hub?
Currently not seeing issues on our staging system with v8.8.0...

@Umkus
Copy link

Umkus commented Oct 26, 2017

@depoulo Same here. I see this in production on latest node:alpine, happens around every 15 minutes, sadly.

@apapirovski
Copy link
Member

apapirovski commented Oct 26, 2017

@depoulo @Umkus best to stay on 8.7.0 until 8.8.1 makes its way there. Sorry for the hassle.

@apapirovski
Copy link
Member

@Umkus by the way if you happen to have more info re: what your code does and any dependencies, that would be helpful. I don't think we really have enough tests around this right now.

@Umkus
Copy link

Umkus commented Oct 26, 2017

Things are back to normal after pinning docker image to node:8.7-alpine.

@apapirovski
(Full disclosure: I'm not a professional nodejs developer)

Here's the (changed for readability) piece of code that I touched today, roughly before the app started to crash periodically:

let pings = {};

// asynchronously
if (!pings[hash]) {
    pings[hash] = setInterval(callbackFunc.bind(null, socket), 5000);
}

// asynchronously, after some time and under some conditions:
clearTimeout(pings[hash]);
delete pings[socket.room];

The only thing I actually changed was the addition of the delete statement right after clearing the timer. So that might be the culprit.

The app uses redis, socket.io and shuffle-array.

@apapirovski
Copy link
Member

apapirovski commented Oct 26, 2017

@Umkus It was definitely not your code. There was a full-blown, legitimate bug in 8.8.0 — I'm just trying to figure out the exact scenarios where it occurs. I'll have a look at socket.io and see if there's anything that can be stripped out into a node test to improve our coverage. Thanks for providing the info!

addaleax pushed a commit to ayojs/ayo that referenced this issue Oct 26, 2017
This commit handles the case where _onTimeout is called with a
null handle.

Refs: nodejs/node#15791
Fixes: nodejs/node#16484
PR-URL: nodejs/node#16489
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
addaleax pushed a commit to ayojs/ayo that referenced this issue Dec 7, 2017
This commit handles the case where _onTimeout is called with a
null handle.

Refs: nodejs/node#15791
Fixes: nodejs/node#16484
PR-URL: nodejs/node#16489
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
apapirovski added a commit to apapirovski/node that referenced this issue Dec 12, 2017
This commit handles the case where _onTimeout is called with a
null handle.

Refs: nodejs#15791
Fixes: nodejs#16484
PR-URL: nodejs#16489
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
MylesBorins pushed a commit that referenced this issue Dec 20, 2017
This commit handles the case where _onTimeout is called with a
null handle.

Backport-PR-URL: #16420
Refs: #15791
Fixes: #16484
PR-URL: #16489
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
MylesBorins pushed a commit that referenced this issue Jan 2, 2018
This commit handles the case where _onTimeout is called with a
null handle.

Backport-PR-URL: #16420
Refs: #15791
Fixes: #16484
PR-URL: #16489
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed-bug Issues with confirmed bugs. net Issues and PRs related to the net subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants