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

SIGTERM handling #214

Open
arietto opened this issue Jun 21, 2019 · 6 comments
Open

SIGTERM handling #214

arietto opened this issue Jun 21, 2019 · 6 comments

Comments

@arietto
Copy link

arietto commented Jun 21, 2019

Hello! Why is void UnixFork::handleSigTerm() body inactive?
I have to use QProcess, which starts and stops cutelyst-wsgi2. QProcess emits SIGTERM within terminate(). What would you advise?

@arietto
Copy link
Author

arietto commented Jun 21, 2019

Would you like to consider https://github.com/Skycoder42/QCtrlSignals for inspiration?

@arietto
Copy link
Author

arietto commented Jun 21, 2019

BTW,
/**
* This signal is likely to be emitted when the worker process should
* stop, at this point the application has a limited time to finish it's
* operations, if a timeout is reached the application will get killed.
*/
void shuttingDown(Application *app);
Where is this timeout hardcoded? I just have one master process without workers (I don't need concurrent workers).

@arietto
Copy link
Author

arietto commented Jun 21, 2019

Should I add SIGTERM to case in void UnixFork::setupSocketPair(bool closeSignalsFD, bool createPair)?

 case SIGINT:
 case SIGQUIT:
 handleSigInt();
 break;

@dantti
Copy link
Member

dantti commented Jun 21, 2019

hmm I don't recall why I don't handle SIGTERM, one thing I've looked into that project some time ago was to Fix CTRL+C on Windows, which ATM crash.

@arietto
Copy link
Author

arietto commented Jun 21, 2019

And what about void shuttingDown(Application *app); timeout? I have to emit signals in the corresponding slot slotShuttingDown in order to gracefully terminate some non-Cutelyst threads. Sometimes I receive a log message which shows that QThread was deleted but the thread is still active.

@dantti
Copy link
Member

dantti commented Mar 29, 2022

This might be fixed with commit 6e56383

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