-
Notifications
You must be signed in to change notification settings - Fork 10
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
Shutdown scripts throw an exception in Windows #392
Comments
That sounds good to me! |
Looking back over the background to shutdown scripts, (e.g. #156 and #354) I see no rationale for having them run in the background other than a casual mention by me in #156:
It may actually be misleading to to have long-running shutdown scripts run in the background since the user would not see a clear indication that it had completed. I just ran a version of the create_structure_files.php script as a foreground job and it worked fine. So, can we think of any reason to not run shutdown scripts only as foreground jobs, or is there any reason we should build in OS-specific logic to do this only on Windows? |
I favor foreground so that, as you say, the user will know when they have completed.
…Sent from my iPhone
On Jun 1, 2017, at 1:38 PM, Mark Jordan <notifications@github.com<mailto:notifications@github.com>> wrote:
Looking back over the background to shutdown scripts, (e.g. #156<#156> and #354<#354>) I see no rationale for having them run in the background other than a casual mention by me in #156<#156>:
One way of implementing this would be using register_shutdown_function(), having the hook scripts run as background processes.
It may actually be misleading to to have long-running shutdown scripts run in the background since the user would not see a clear indication that it had completed.
I just ran a version of the create_structure_files.php script as a foreground job and it worked fine.
So, can we think of any reason to not run shutdown scripts only as foreground jobs, or is there any reason we should build in OS-specific logic to do this only on Windows?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#392 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ABEMrKGyPlQVsPE3klib-s9q8KREun9mks5r_vcogaJpZM4NsNev>.
|
Thanks for the feedback @jpeak5. I'll wait for @MarcusBarnes to weigh in before opening a PR. |
A second @jpeak5's take. Thank you. |
OK, sounds like we have consensus. I'm happy to open a PR for evaluation. |
Thanks @MarcusBarnes, I'll update https://github.com/MarcusBarnes/mik/wiki/Shutdown-hooks to reflect this change. |
Running shutdown scripts on Windows produces the following type of error:
The script ends up not running. This is an known issue with the Cocur library we are using.
This makes me wonder if we need to run shutdown scripts as background processes. It makes a lot of sense to run post-write hooks in the background so they don't slow down moving on to the next package, but that same logic doesn't apply to shutdown hooks. @jpeak5 and @MarcusBarnes, any thoughts? We can also build in logic such that if mik is running on Windows, it doesn't use Cocur, it just runs the scripts in the foreground. On Linux and OSX, it runs them in the background.
The text was updated successfully, but these errors were encountered: