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

Ping Pong! #64

Closed
wants to merge 1 commit into from
Closed

Ping Pong! #64

wants to merge 1 commit into from

Conversation

mjangda
Copy link
Member

@mjangda mjangda commented Feb 4, 2016

Make the app send periodic pings to Calypso to make sure the server is still running. If we fail to get a response, we can detect that and handle accordingly.

Needs Automattic/wp-calypso#3062 to work

Fixes #51

Make the app send periodic pings to Calypso to make sure the server
is still running. If we fail to get a response, we can detect that
and handle accordingly.
@mjangda
Copy link
Member Author

mjangda commented Feb 4, 2016

We need to decide if maybeKillswitch should kill the calypso server or restart it.

Also, looks like there may be issues when going into screensaver or sleep mode.

@johngodley
Copy link
Member

Seems to work although I've not been able to get the Failed to get ping from Calypso; exiting. message to appear (I may be doing something wrong, or the app exits before the message is shown). No processes are left behind.

What happens when the system goes to sleep - does the kill timer expire on wakeup?

@mjangda
Copy link
Member Author

mjangda commented Feb 4, 2016

I can't reproduce the sleep issue now. I think it may have been something else.

Things I've tested:

Kill Electron

  • make run
  • find pids using ps aux | grep [e]lectron
  • kill -9 the 2 main electron processes using the pids
  • ps aux | grep [e]lectron shortly after and verify the bundle-desktop.js process is no longer running

Kill Calypso

  • make run
  • find pid for bundle-desktop.js using ps aux | grep [e]lectron
  • kill -9 using the pid
  • console shows the following:
desktop:server app.exit with code: 0 (SIGKILL) +2s
  desktop:server app.close with code: 0 (SIGKILL) +1ms
  desktop:server Failed to get ping from Calypso; exiting. +28s
  desktop:server Killing server +1ms

The window stays open and the app continues to mostly work (since it's an SPA :)) but breaks if you log out. In this instance, it would be nice if we could gracefully restart the server, or show an error to the user.

@mjangda
Copy link
Member Author

mjangda commented Feb 9, 2016

No longer necessary as of #66

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

Successfully merging this pull request may close these issues.

2 participants