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

Handling server restart gracefully #358

Open
MisterTea opened this issue Feb 3, 2015 · 1 comment
Open

Handling server restart gracefully #358

MisterTea opened this issue Feb 3, 2015 · 1 comment

Comments

@MisterTea
Copy link

Hey ShareJS team,

I'm using the inmemory livedb. When my server restarts, the documents are destroyed, which is fine. The problem is that there seems to be no way to notify clients that their document is destroyed. As a client, this is what the log shows:

 GET http://localhost:3000/channel/bind?a=jr35f2vb5gtv&VER=8&RID=rpc&SID=6jux6ccm&CI=1&AID=2&TYPE=xmlhttp&zx=b7zhvc9i4rm3&t=1 net::ERR_CONNECTION_REFUSED
bcsocket.js:46 GET http://localhost:3000/channel/bind?a=jr35f2vb5gtv&VER=8&RID=rpc&SID=6jux6ccm&CI=1&AID=2&TYPE=xmlhttp&zx=pkj9d2i2n4et&t=2 net::ERR_CONNECTION_REFUSED
bcsocket.js:46 GET http://localhost:3000/channel/bind?a=jr35f2vb5gtv&VER=8&RID=rpc&SID=6jux6ccm&CI=1&AID=2&TYPE=xmlhttp&zx=bxr9rhy31zg3&t=3 net::ERR_CONNECTION_REFUSED
bcsocket.js:46 GET http://localhost:3000/channel/bind?a=jr35f2vb5gtv&VER=8&RID=rpc&SID=6jux6ccm&CI=1&AID=2&TYPE=xmlhttp&zx=55p6if8b7u9k&t=4 

Then when the server recovers:

share.uncompressed.js:930 Ignoring attempt to ingest data in state ready

The client stays in this state until the client tries to make a change, upon which the server crashes with "document not found" and the client gets this:

Operation was rejected (Document does not exist). Trying to rollback change locally.
share.uncompressed.js:676 Op apply failed and the operation could not be reverted

I would like to change this behavior so that, when the client reconnects to the server, it detects that the server has restarted. I can then handle the document being destroyed correctly on the client side. Can I catch that "Ignoring attempt to ingest..." warning? How do I handle this case?

Thanks!
Jason G, sole developer of Tidalwave: https://github.com/MisterTea/TidalWave

@dignifiedquire
Copy link
Contributor

Have you tried with the latest version from github? There were some changes in the code that made a lot of these notifications more resilient if I remember correctly.

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

2 participants