Skip to content

Commit 3a023c1

Browse files
authored
Crash on uncaught exceptions in monitor threads
Crashes in monitor threads potentially cause resource leaks. Let's crash by default on uncaught exceptions.
1 parent 3a90277 commit 3a023c1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

samza-rest/src/main/java/org/apache/samza/rest/SamzaRestService.java

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
*/
1919
package org.apache.samza.rest;
2020

21+
import com.google.common.util.concurrent.UncaughtExceptionHandlers;
2122
import java.util.Map;
2223
import joptsimple.OptionSet;
2324
import org.apache.samza.config.Config;
@@ -83,6 +84,7 @@ public SamzaRestService(Server server,
8384
*/
8485
public static void main(String[] args)
8586
throws Exception {
87+
Thread.setDefaultUncaughtExceptionHandler(UncaughtExceptionHandlers.systemExit());
8688
SamzaMonitorService monitorService = null;
8789
try {
8890
SamzaRestConfig config = parseConfig(args);

0 commit comments

Comments
 (0)