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

restarted instances on non-primary ports don't listen #4870

Closed
BenLubar opened this issue Jul 20, 2016 · 7 comments
Closed

restarted instances on non-primary ports don't listen #4870

BenLubar opened this issue Jul 20, 2016 · 7 comments

Comments

@BenLubar
Copy link
Contributor

NodeBB version 1.1.0, git hash 8584f9a

  1. NodeBB occasionally hangs for us. We haven't found the culprit yet, but we have a script that kills an instance if it doesn't respond to a request within 5 seconds.
  2. Our build script changes the code that sets the cache buster to a random UUID to use a random hex string assigned during upgrades.
  3. When the primary instance (4567) restarts, users receive a "the forum has been updated, click here to refresh" notification.
  4. When the secondary instance (4568) restarts, it waits until the primary instance gives the "all clear" signal, which won't happen if the primary instance has already given the signal.

Expected: the loader.js process remembers that the preparation of JS and CSS has already been run and immediately tells the secondary instance it can continue.
Actual: the secondary app.js process waits indefinitely until the primary app.js process restarts and runs the preparation.

Expected: restarted instances don't trigger the update notification if the cache buster is the same as it was previously.
Actual: restarting an instance always triggers the update notification, regardless of what the cache buster is.

BenLubar added a commit to BenLubar/NodeBB that referenced this issue Jul 20, 2016
…ompiled message. Fix update notification always appearing when an instance restarts even if there was no update. Closes NodeBB#4870
@boomzillawtf
Copy link
Contributor

And by "hangs for us," means that the node process sits at 100% CPU usage according to top.

@julianlam
Copy link
Member

Is this "the reason" your NodeBB goes down?

@BenLubar
Copy link
Contributor Author

No, but it's the reason it makes noise when it comes back up.

@boomzillawtf
Copy link
Contributor

Well, sort of. I mean...it gets stuck with 100% CPU doing something. There's no pattern to where it seems to get stuck. There are some gzipped tarballs here with linux perf tools stack traces and flamegraphs:

https://what.thedailywtf.com/topic/19990/the-official-server-cooties-tracking-thread

Those are a representative sampling of what we've seen when this happens. The process that's "stuck" somewhere is busy doing whatever it's doing and not responding to other requests. So as far as the user is concerned, the site is down (or half down, if you're talking to the unlucky process and it wasn't both processes that were pegging).

We just have no idea why it would be getting stuck.

BenLubar added a commit to boomzillawtf/tdwtf that referenced this issue Jul 21, 2016
…:compiled message. Fix update notification always appearing when an instance restarts even if there was no update. <NodeBB/NodeBB#4870> <NodeBB/NodeBB#4871>
@barisusakli
Copy link
Member

What nodejs version and does it still happen when you disable all custom functionality?

@xidui
Copy link

xidui commented Jul 22, 2016

@BenLubar
Waiting forever?
I had the experience that I will wait for several minutes with no response but 100% CPU of nodejs.
It recovers after about 3 minutes.

Not only restarts nodebb, but also restart nginx causes this as well.

My nodejs version is 4.4.3

@BenLubar
Copy link
Contributor Author

@xidui in this case, it was waiting for a templates:compiled message that was never sent. This isn't the bug that causes 100% CPU usage and unresponsiveness - this is before the instance starts listening for connections.

ralic pushed a commit to ralic/NodeBB that referenced this issue Jul 22, 2016
…ompiled message. Fix update notification always appearing when an instance restarts even if there was no update. Closes NodeBB#4870 (NodeBB#4871)
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

5 participants