mirror of
https://github.com/vale981/ray
synced 2025-03-06 02:21:39 -05:00
[JAVA] setDefaultUncaughtExceptionHandler to log uncaught exception in user thread. (#4798)
* Add WorkerUncaughtExceptionHandler * Fix * revert bazel and pom
This commit is contained in:
parent
1490a98a71
commit
98dd033179
2 changed files with 5 additions and 2 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue