-
Notifications
You must be signed in to change notification settings - Fork 12
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
[Optimize] graceful shutdown issues in some special cases. #47
Comments
Hey @EdmondFrank, thanks for reporting and the patch. So you are spawning If possible can you share the Elixir code for the same? if you have it at hand :) |
Sure, I created a minimal test repository for you based on my use case: https://github.com/EdmondFrank/exile_log_collector |
@EdmondFrank sorry for the late response, I got caught up with my day job. Thanks for sharing the repo. I understand the issue in general but in this specific case it seems GNU Parallel behaviour is changed? https://git.savannah.gnu.org/cgit/parallel.git/tree/NEWS#n1036, see: https://superuser.com/questions/1660301/gnu-parallel-is-behaving-differently-on-sigterm-in-two-cygwin-installations It no longer requires multiple
Can share which version you are using? |
Yes, it seems that the version I used on my deployment machine is too old. GNU Parallel behavior has changed in newer versions. When I upgraded it to the latest version, the problem was fixed. $ parallel --version
GNU parallel 20190122
Copyright (C) 2007-2019 Ole Tange and Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
GNU parallel comes with no warranty.
Web site: http://www.gnu.org/software/parallel
When using programs that use GNU Parallel to process data for publication
please cite as described in 'parallel --citation'.
Thank you for your very much focus on this issue. If you still have an interest in optimizing this special case, maybe you can build an older version from source. I could reproduce the issue on this version. |
Hey @EdmondFrank, thanks for the confirmation. Agree about still handling the special case. I'll push changes based on your suggestion soon. Thanks! |
Hi akash-aky, First of all, thank you for creating
Exile
, it's a very amazing library! I recently ran into some problems using it to executeparallel
this application, here are my debug result:As you can see above, while running parallel with
Exile.stream!
, I closed my application, but the external processes opened byExile
were not cleaned up correctly.I think the reason may be that these particular processes need to send the
SIGTERM
signal multiple times for a graceful shutdown.I tried to look up the code and found that
Exile
usesSIGKILL
to force the process to terminate directly after sending aSIGTERM
timeout, resulting in thetail
process opened byparallel
not being properly shut down even though the parallel process is force-terminated.So I tried to make a simple and rough patch to deal with this scenario: trying to send
SIGTERM
3 times at first, if it can't be closed gracefully then sendSIGKILL
to force kill this external process.I'll make a pull request if you'd like to merge in this patch.
The text was updated successfully, but these errors were encountered: