Skip to content

Commit 285dd25

Browse files
author
Ugo Plouviez
committed
Do not restart the worker if the ping fails
1 parent 9df3a7f commit 285dd25

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/java/com/iexec/worker/PingService.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,16 @@ public void pingScheduler() {
2828
String sessionId = feignClient.ping();
2929
String currentSessionId = coreConfigurationService.getCoreSessionId();
3030
if (currentSessionId == null || currentSessionId.isEmpty()){
31+
log.info("First ping from the worker, setting the sessionId [coreSessionId:{}]", sessionId);
3132
coreConfigurationService.setCoreSessionId(sessionId);
3233
return;
3334
}
3435

36+
if(sessionId != null && sessionId.equals("")){
37+
log.warn("The worker cannot ping the core!");
38+
return;
39+
}
40+
3541
if (sessionId != null && !sessionId.equalsIgnoreCase(currentSessionId)){
3642
// need to reconnect to the core by restarting the worker
3743
log.warn("Scheduler seems to have restarted [currentSessionId:{}, coreSessionId:{}]", currentSessionId, sessionId);

0 commit comments

Comments
 (0)