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

When aw-qt crashes, aw-server does not shut down #31

Closed
nikanar opened this issue Jul 20, 2017 · 3 comments
Closed

When aw-qt crashes, aw-server does not shut down #31

nikanar opened this issue Jul 20, 2017 · 3 comments

Comments

@nikanar
Copy link

nikanar commented Jul 20, 2017

Same issue as ActivityWatch/aw-qt#19, only this process is a Flask server, and run is inherited from Flask, so I can't put a if os.getppid() == 1 inside it.

Flask has ways to shut itself down, but typically by setting up a /shutdown page that sends the shutdown call when requested, here we don't want to rely on requests, more like setup a watchdog. Here gives similar options. There my questions is asked, and most of the answer is "app.run() is only meant for development", not too helpful.

Now, does the server really have to be restarted ? Should aw-qt test whether the server is already up, and maybe connect to it rather than start it, if it's already alive ?

@ErikBjare
Copy link
Member

ErikBjare commented Jul 22, 2017 via email

@johan-bjareholt
Copy link
Member

johan-bjareholt commented Jul 22, 2017

@ErikBjare The top answer on the first SO link did it by creating a second process, and a lower rated solution on SO did it with threads like you mentioned. Should work fine, and takes up less resources than starting a whole new process.

@ErikBjare
Copy link
Member

ErikBjare commented Oct 6, 2018

I think this was solved? If not aw-qt doesn't crash anymore so haven't really seen any instances of this.

Closing in the meantime since I'm trying to move all actual issues into the main repo. If this remains a problem, open a new issue there and reference this one.

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

3 participants