mirror of
https://github.com/wassname/ray.git
synced 2026-06-29 23:25:24 +08:00
[JAVA] setDefaultUncaughtExceptionHandler to log uncaught exception in user thread. (#4798)
* Add WorkerUncaughtExceptionHandler * Fix * revert bazel and pom
This commit is contained in:
@@ -76,13 +76,13 @@ public class GcsClient {
|
||||
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 class DefaultWorker {
|
||||
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();
|
||||
|
||||
Reference in New Issue
Block a user