Comments (12)
You guys are awesome; we'll test it when we get a chance and keep you posted!
from socialize-server-presence.
Yeah, I don't see any reason that process.exit()
can't be removed completely. Kind of selfish of the package to assume that nothing else will attempt to catch the exit.
from socialize-server-presence.
So basically what's going on here is the server detects that it's own document has been removed from the database. If the server is the currently the "watcher" it'll just recover by reinserting it's document and things will go on as normal.. If it's not the watcher though, this means that another server is and it has just executed any cleanup functions that were registered. This leaves the application in a state that assumes the server has died and no reliable way to recover from this situation, therefore the last resort is to just exit and come back with a fresh consistent state.
The reason for the exit()
is that in its current configuration calling process.kill(process.pid, 'SIGHUP')
would execute the process.on('SIGHUP')
calling the stop method which would try to update the document that's been deleted from the server and run the cleanup functions that were already run. This is an easy fix though and I'll get fixed and released so you guys can get back to worrying about the big issues 😃
from socialize-server-presence.
It worked! During today's deployment, ongoing connections were gradually moved to new containers as expected. Cheers!
from socialize-server-presence.
Is this the only package in the set that your app uses?
from socialize-server-presence.
@copleykj Yes, we wrote our own minimalist implementation of socialize-user-presence
.
from socialize-server-presence.
Awesome! We've done a lot of updates to the package set and are really close to a release. Since you guys aren't using any other packages in the set that would cause the dependency resolver to hold back the upgrade of the server presence package I can get this fix in and issue a release just for this package.
from socialize-server-presence.
There you go.
from socialize-server-presence.
Hmm, process.exit()
is still called on https://github.com/copleykj/socialize-server-presence/blob/master/server-presence.js#L49. Is it intentional?
I don't see why the sync needs to happen both ways. The servers should keep the DB up-to-date and never the other way around.
Here's how I see it - there are 2 possible scenarios when a server
document is removed:
- Server has already terminated itself.
- Server is still online but failed to update the
server
document in time (it might be in the middle a deployment). It shouldn't be asked to shutdown. It will update the document when it gets the opportunity.
Or maybe I'm missing something? Thoughts?
from socialize-server-presence.
Should be all set. Let me know if you need anything else.
from socialize-server-presence.
Hey @anault, just wanted to make sure the fix was satisfactory.
from socialize-server-presence.
We are deploying the fix this week and then we'll have to test it against another deployment (probably next week). I'll come back with an answer asap.
from socialize-server-presence.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from socialize-server-presence.