Skip to content

Commit 4f010c9

Browse files
committed
Do not cancel monitoring if unable to fetch status from chronos control
1 parent cb2b434 commit 4f010c9

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

src/main/java/ch/unibas/dmi/dbis/chronos/agent/AbstractChronosAgent.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ of this software and associated documentation files (the "Software"), to deal
4545
import java.util.TimerTask;
4646
import java.util.concurrent.ConcurrentHashMap;
4747
import java.util.concurrent.TimeUnit;
48+
import java.util.concurrent.atomic.AtomicInteger;
4849
import lombok.extern.slf4j.Slf4j;
4950
import net.lingala.zip4j.ZipFile;
5051
import net.lingala.zip4j.model.ZipParameters;
@@ -678,6 +679,8 @@ private class AbortedMonitorTask extends TimerTask {
678679

679680
private final ChronosJob observable;
680681

682+
private final AtomicInteger getStatusErrorCounter = new AtomicInteger( 0 );
683+
681684

682685
/**
683686
*
@@ -710,9 +713,13 @@ public void run() {
710713
// Quietly cancelObservation and de-register this observable since it is already finished
711714
cancelAndRemoveObservable();
712715
}
716+
getStatusErrorCounter.set( 0 );
713717
} catch ( NoSuchElementException | ChronosException | IOException ex ) {
714-
log.warn( "getStatus for \"" + this.observable + "\" failed. Canceling monitoring!", ex );
715-
cancelAndRemoveObservable();
718+
getStatusErrorCounter.incrementAndGet();
719+
if ( getStatusErrorCounter.get() % 10 == 0 ) {
720+
log.warn( "Unable to get status of \"" + this.observable + "\" since quite a while.", ex );
721+
}
722+
//cancelAndRemoveObservable();
716723
} catch ( InterruptedException ex ) {
717724
log.warn( "We have been interrupted!", ex );
718725
cancelAndRemoveObservable();

src/main/java/ch/unibas/dmi/dbis/chronos/agent/ChronosHttpClient.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,6 @@ private boolean notifyChronos( final ChronosJob job, final Properties uploadConf
567567
Exception lastException;
568568

569569
do {
570-
571570
try {
572571
// NOTICE: intentional return!
573572
return this.doNotifyChronos( job, uploadConfiguration, parameters );
@@ -579,7 +578,6 @@ private boolean notifyChronos( final ChronosJob job, final Properties uploadConf
579578
if ( norifyChronosAttempt < maxAttempts ) {
580579
Thread.sleep( failedAttemptSleepTimeMillis );
581580
}
582-
583581
} while ( norifyChronosAttempt++ < maxAttempts );
584582

585583
throw new IOException( "The maximum number of attempts reached. See above WARNINGs for details. The last exception was: ", lastException );

0 commit comments

Comments
 (0)