mirror of
https://github.com/PowerJob/PowerJob.git
synced 2025-07-17 00:00:04 +08:00
feat: optimize exception log in server elect #551
This commit is contained in:
parent
a5e3e829b5
commit
b89ac389fd
@ -24,6 +24,7 @@ import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
/**
|
||||
* Default server election policy, first-come, first-served, no load balancing capability
|
||||
@ -162,8 +163,10 @@ public class ServerElectionService {
|
||||
log.warn("[ServerElection] server[{}] is active but don't have target protocol", serverAddress);
|
||||
}
|
||||
}
|
||||
}catch (Exception e) {
|
||||
log.warn("[ServerElection] server[{}] was down.", serverAddress, e);
|
||||
} catch (TimeoutException te) {
|
||||
log.warn("[ServerElection] server[{}] was down due to ping timeout!", serverAddress);
|
||||
} catch (Exception e) {
|
||||
log.warn("[ServerElection] server[{}] was down with unknown case!", serverAddress, e);
|
||||
}
|
||||
downServerCache.add(serverAddress);
|
||||
return null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user