Skip to content

Commit

Permalink
refactor: minor change in cleanup's exception output in case Redis is…
Browse files Browse the repository at this point in the history
… unavailable
  • Loading branch information
VonDerBeck committed Sep 28, 2023
1 parent a1e370a commit c3727cb
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
import io.camunda.zeebe.exporter.api.context.Context;
import io.camunda.zeebe.exporter.api.context.Controller;
import io.camunda.zeebe.protocol.record.Record;
import io.lettuce.core.RedisClient;
import io.lettuce.core.RedisFuture;
import io.lettuce.core.SetArgs;
import io.lettuce.core.XTrimArgs;
import io.lettuce.core.*;
import io.lettuce.core.api.StatefulRedisConnection;
import io.zeebe.exporter.proto.RecordTransformer;
import io.zeebe.exporter.proto.Schema;
Expand Down Expand Up @@ -184,6 +181,8 @@ private void trimStreamValues() {
}
}
});
} catch (RedisCommandTimeoutException | RedisConnectionException ex) {
logger.error("Error during cleanup due to possible Redis unavailability: ", ex.getMessage());
} catch (Exception ex) {
logger.error("Error during cleanup", ex);
} finally {
Expand Down Expand Up @@ -226,6 +225,8 @@ private boolean acquireCleanupLock() {
}
}
}
} catch (RedisCommandTimeoutException | RedisConnectionException ex) {
logger.error("Error acquiring cleanup lock due to possible Redis unavailability: ", ex.getMessage());
} catch (Exception ex) {
logger.error("Error acquiring cleanup lock", ex);
}
Expand All @@ -235,6 +236,8 @@ private boolean acquireCleanupLock() {
private void releaseCleanupLock() {
try {
redisConnection.sync().del(CLEANUP_LOCK);
} catch (RedisCommandTimeoutException | RedisConnectionException ex) {
logger.error("Error releasing cleanup lock due to possible Redis unavailability: ", ex.getMessage());
} catch (Exception ex) {
logger.error("Error releasing cleanup lock", ex);
}
Expand Down

0 comments on commit c3727cb

Please sign in to comment.