Skip to content
Permalink
Browse files

[JAVA] setDefaultUncaughtExceptionHandler to log uncaught exception i…

…n user thread. (#4798)

* Add WorkerUncaughtExceptionHandler

* Fix

* revert bazel and pom
  • Loading branch information...
guoyuhong committed May 16, 2019
1 parent 1490a98 commit 98dd0331793402cd8ed88f94e056abd9f5348c91
@@ -76,13 +76,13 @@ public GcsClient(String redisAddress, String redisPassword) {
NodeInfo nodeInfo = new NodeInfo(
clientId, data.nodeManagerAddress(), true, resources);
clients.put(clientId, nodeInfo);
} else if (data.entryType() == EntryType.RES_CREATEUPDATE){
} else if (data.entryType() == EntryType.RES_CREATEUPDATE) {
Preconditions.checkState(clients.containsKey(clientId));
NodeInfo nodeInfo = clients.get(clientId);
for (int i = 0; i < data.resourcesTotalLabelLength(); i++) {
nodeInfo.resources.put(data.resourcesTotalLabel(i), data.resourcesTotalCapacity(i));
}
} else if (data.entryType() == EntryType.RES_DELETE){
} else if (data.entryType() == EntryType.RES_DELETE) {
Preconditions.checkState(clients.containsKey(clientId));
NodeInfo nodeInfo = clients.get(clientId);
for (int i = 0; i < data.resourcesTotalLabelLength(); i++) {
@@ -15,6 +15,9 @@
public static void main(String[] args) {
try {
System.setProperty("ray.worker.mode", "WORKER");
Thread.setDefaultUncaughtExceptionHandler((Thread t, Throwable e) -> {
LOGGER.error("Uncaught worker exception in thread {}: {}", t, e);
});
Ray.init();
LOGGER.info("Worker started.");
((AbstractRayRuntime)Ray.internal()).loop();

0 comments on commit 98dd033

Please sign in to comment.
You can’t perform that action at this time.