[ 
https://issues.apache.org/jira/browse/MAPREDUCE-5387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13708079#comment-13708079
 ] 

Ivan Mitic commented on MAPREDUCE-5387:
---------------------------------------

Copy-pasting [~cnauroth] comment from MAPREDUCE-5330:

{quote}
I came across similar issues while working on the YARN nodemanager changes for 
Windows. Bikas, I agree that this logic doesn't exactly match the meaning of 
SIGTERM. To match SIGTERM, we really need a way for one process to signal 
another process with some "graceful shutdown" message, and a way for the other 
process to trigger custom code when it receives that message. Unfortunately, 
I'm not aware of anything in the Windows API that provides an exact match. 
Therefore, the logic in this patch seems to be the closest approximation that's 
feasible right now.

To elaborate on this, TerminateProcess immediately kills the target process, 
and there is no way for that process to trap the call and run custom clean-up 
code.

http://msdn.microsoft.com/en-us/library/windows/desktop/ms686714(v=vs.85).aspx

This is much different from Unix signals, which allow the target process to 
install signal handlers to respond gracefully to things like SIGTERM.

There also seems to be some support for programmatically sending CTL-C to a 
process and installing a custom handler to respond to it. This would be 
SetConsoleCtrlHandler and GenerateConsoleCtrlEvent. I've heard anecdotally that 
this can be used to create a rough approximation of Unix signals, but I haven't 
tried it myself.

http://msdn.microsoft.com/en-us/library/windows/desktop/ms686016(v=vs.85).aspx

http://msdn.microsoft.com/en-us/library/windows/desktop/ms683155(v=vs.85).aspx

Aside from that, the only other option seems to be for Windows applications to 
roll their own custom IPC protocol (i.e. one process sends another a custom 
graceful shutdown message over a named pipe).

It might be worth pursuing one of these solutions in the long term for absolute 
correctness, but these approaches will require a lot more coding and testing.
{quote}
                
> Implement Signal.TERM on Windows
> --------------------------------
>
>                 Key: MAPREDUCE-5387
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-5387
>             Project: Hadoop Map/Reduce
>          Issue Type: Bug
>    Affects Versions: 3.0.0, 1-win, 2.1.0-beta
>            Reporter: Ivan Mitic
>            Assignee: Ivan Mitic
>
> Signal.TERM is currently not supported by Hadoop on the Windows platform. 
> Tracking Jira for the problem. 
> A couple of things to keep in mind:
>  - Support for process groups (JobObjects on Windows)
>  - Solution should work for both java and other streaming Hadoop apps

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to