zhengchenyu commented on PR #6972:
URL: https://github.com/apache/hadoop/pull/6972#issuecomment-2298784707

   The reason for the failure of 
TestServiceInterruptHandling::testRegisterAndRaise has been found. So close 
this PR.
   
   I found SIGINT was ignored before executing 
TestServiceInterruptHandling::testRegisterAndRaise. In the Java code, for 
SIGHUP, SIGINT, and SIGTERM, if its SignalHandler have been set to SIG_IGN, any 
further actions to set SignalHandler will be invalid. For details, see [jdk 
signal](https://github.com/openjdk/jdk/blob/48ad07fd2cacdfcde606b33a369b1bf8df592088/hotspot/src/os/linux/vm/jvm_linux.cpp#L76)
   
   In fact, it is difficult for me to reproduce this bug on my current 
computer. But if you add `Signal.handle(new Signal(IrqHandler.CONTROL_C), 
SignalHandler.SIG_IGN);` in front of `irqHandler.bind();`, it can be reproduced 
stably, which also proves that what I said before is correct.
   
   In order to further prove this problem on docker ci, I submitted 
[commit](https://github.com/apache/hadoop/pull/6972/commits/57d8f6d20cfaef2a7a6512ff74c7a767297c834d),
 then will find the following error like this:
   ```
   [ERROR] 
testRegisterAndRaise(org.apache.hadoop.service.launcher.TestServiceInterruptHandling)
  Time elapsed: 0.017 s  <<< FAILURE!
   java.lang.AssertionError: SIGINT have been ignored, so can not set signal 
handler.
        at org.junit.Assert.fail(Assert.java:89)
        at org.junit.Assert.assertTrue(Assert.java:42)
        at org.junit.Assert.assertFalse(Assert.java:65)
   ```
   It also proves that SIGINT is ignored.
   
   I will fix it in [7008](https://github.com/apache/hadoop/pull/7008).
   
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to