mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-20 21:48:04 +01:00
Improve test Redis cluster setup and teardown
This commit is contained in:
@@ -9,6 +9,7 @@ import com.google.common.annotations.VisibleForTesting;
|
||||
import io.github.resilience4j.circuitbreaker.CallNotPermittedException;
|
||||
import io.github.resilience4j.circuitbreaker.CircuitBreaker;
|
||||
import io.github.resilience4j.circuitbreaker.CircuitBreakerConfig;
|
||||
import io.lettuce.core.RedisNoScriptException;
|
||||
import io.lettuce.core.protocol.CommandHandler;
|
||||
import io.lettuce.core.protocol.CompleteableCommand;
|
||||
import io.lettuce.core.protocol.RedisCommand;
|
||||
@@ -112,9 +113,10 @@ public class LettuceShardCircuitBreaker implements NettyCustomizer {
|
||||
command.onComplete((ignored, throwable) -> {
|
||||
final long durationNanos = System.nanoTime() - startNanos;
|
||||
|
||||
if (throwable != null) {
|
||||
// RedisNoScriptException doesn’t indicate a fault the breaker can protect
|
||||
if (throwable != null && !(throwable instanceof RedisNoScriptException)) {
|
||||
breaker.onError(durationNanos, TimeUnit.NANOSECONDS, throwable);
|
||||
logger.debug("Command completed with error", throwable);
|
||||
logger.warn("Command completed with error", throwable);
|
||||
} else {
|
||||
breaker.onSuccess(durationNanos, TimeUnit.NANOSECONDS);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user