[jira] [Commented] (MAPREDUCE-5387) Implement Signal.TERM on Windows

2013-10-14 Thread Andrey Klochkov (JIRA)

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

Andrey Klochkov commented on MAPREDUCE-5387:


I uploaded the patch which implements approximations for both QUIT and TERM for 
Windows, via console event handlers. See [YARN-445].

 Implement Signal.TERM on Windows
 

 Key: MAPREDUCE-5387
 URL: https://issues.apache.org/jira/browse/MAPREDUCE-5387
 Project: Hadoop Map/Reduce
  Issue Type: Improvement
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 was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Commented] (MAPREDUCE-5387) Implement Signal.TERM on Windows

2013-10-11 Thread Andrey Klochkov (JIRA)

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

Andrey Klochkov commented on MAPREDUCE-5387:


Indeed, [YARN-445] is related. Thanks to [~cnauroth] for pointing. I think I 
can put up a patch which sends Ctrl+C to all processes in the job object and 
make Yarn use it as an analog to TERM signal when running on Windows. That 
would be similar to how it's done with Ctrl+Break in [YARN-445].

 Implement Signal.TERM on Windows
 

 Key: MAPREDUCE-5387
 URL: https://issues.apache.org/jira/browse/MAPREDUCE-5387
 Project: Hadoop Map/Reduce
  Issue Type: Improvement
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 was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Commented] (MAPREDUCE-5387) Implement Signal.TERM on Windows

2013-07-14 Thread Ivan Mitic (JIRA)

[ 
https://issues.apache.org/jira/browse/MAPREDUCE-5387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=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