slfan1989 commented on code in PR #8782:
URL: https://github.com/apache/hadoop/pull/8782#discussion_r4576859080
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/main/java/org/apache/hadoop/yarn/server/timelineservice/reader/TimelineReaderServer.java:
##########
@@ -147,10 +147,21 @@ private void join() {
@Override
protected void serviceStop() throws Exception {
+ try {
+ stopTimelineReaderWebApp();
+ } finally {
+ // super.serviceStop() is what stops the reader and, with it, the
+ // storage monitor's polling executor. A web server that fails to
+ // stop must not leave those behind.
+ super.serviceStop();
Review Comment:
Nit: If both the web app and a child service fail to stop, the exception
from `super.serviceStop()` in the `finally` block replaces the original web app
exception. Could we preserve the first exception and attach the child service
failure with `addSuppressed()`, while still attempting to stop all child
services?
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timelineservice/src/test/java/org/apache/hadoop/yarn/server/timelineservice/reader/TestTimelineReaderServer.java:
##########
@@ -60,6 +66,49 @@ void testStartStopServer() throws Exception {
}
}
+ /**
+ * A web server that fails to stop must not take the child services down with
+ * it: the reader is one of them, and it owns the storage monitor's polling
+ * executor, whose threads are not daemons.
+ */
+ @Test
+ @Timeout(60000)
Review Comment:
Nit: JUnit 5 interprets `@Timeout(60000)` as 60,000 seconds by default,
which is 16 hours and 40 minutes. Could we use `@Timeout(60)` so the test fails
promptly if `server.stop()` hangs?
--
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]