-
Notifications
You must be signed in to change notification settings - Fork 9k
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
HADOOP-19329. Remove usage of sun.misc.Signal #7145
base: trunk
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -416,6 +416,11 @@ | |
<artifactId>lz4-java</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.github.jnr</groupId> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the license is tri EPL/GPL/LGPL license. Should be fine. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for your review, and i have added com.github.jnr to GPLv2 module in LICENSE-binary file. |
||
<artifactId>jnr-posix</artifactId> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
<build> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
|
||
package org.apache.hadoop.service.launcher; | ||
|
||
import jnr.constants.platform.Signal; | ||
import org.apache.hadoop.service.BreakableService; | ||
import org.apache.hadoop.service.launcher.testservices.FailureTestService; | ||
import org.apache.hadoop.test.GenericTestUtils; | ||
|
@@ -38,8 +39,8 @@ public class TestServiceInterruptHandling | |
@Test | ||
public void testRegisterAndRaise() throws Throwable { | ||
InterruptCatcher catcher = new InterruptCatcher(); | ||
String name = "USR2"; | ||
IrqHandler irqHandler = new IrqHandler(name, catcher); | ||
String name = "SIGINT"; | ||
IrqHandler irqHandler = new IrqHandler(Signal.valueOf(name), catcher); | ||
irqHandler.bind(); | ||
assertEquals(0, irqHandler.getSignalCount()); | ||
irqHandler.raise(); | ||
|
@@ -61,7 +62,7 @@ public void testInterruptEscalationShutdown() throws Throwable { | |
|
||
// call the interrupt operation directly | ||
try { | ||
escalator.interrupted(new IrqHandler.InterruptData("INT", 3)); | ||
escalator.interrupted(new IrqHandler.InterruptData("SIGINT", 3)); | ||
fail("Expected an exception to be raised in " + escalator); | ||
} catch (ExitUtil.ExitException e) { | ||
assertExceptionDetails(EXIT_INTERRUPTED, "", e); | ||
|
@@ -75,7 +76,7 @@ public void testInterruptEscalationShutdown() throws Throwable { | |
|
||
// now interrupt it a second time and expect it to escalate to a halt | ||
try { | ||
escalator.interrupted(new IrqHandler.InterruptData("INT", 3)); | ||
escalator.interrupted(new IrqHandler.InterruptData("SIGINT", 3)); | ||
fail("Expected an exception to be raised in " + escalator); | ||
} catch (ExitUtil.HaltException e) { | ||
assertExceptionDetails(EXIT_INTERRUPTED, "", e); | ||
|
@@ -93,7 +94,7 @@ public void testBlockingShutdownTimeouts() throws Throwable { | |
InterruptEscalator escalator = new InterruptEscalator(launcher, 500); | ||
// call the interrupt operation directly | ||
try { | ||
escalator.interrupted(new IrqHandler.InterruptData("INT", 3)); | ||
escalator.interrupted(new IrqHandler.InterruptData("SIGINT", 3)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should move to LambdaTestUtils.intercept() here instead of the try/catch clause
|
||
fail("Expected an exception to be raised from " + escalator); | ||
} catch (ExitUtil.ExitException e) { | ||
assertExceptionDetails(EXIT_INTERRUPTED, "", e); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what breaks once this is excluded? the service stuff should be ok as it the irq stuff is only used server side AFAIK.