Skip to content

Commit

Permalink
Do not log a warning when a remote node is shutdown while destroying …
Browse files Browse the repository at this point in the history
…a proxy

Reasoning:
When a member is shutdown then it's not a big deal when a proxy was
not  destryoed. It's just a noise and it looks scary.

See hazelcast#8736
  • Loading branch information
jerrinot committed Aug 19, 2016
1 parent cfad2df commit a6b6fdf
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,26 @@
import static com.hazelcast.internal.metrics.ProbeLevel.MANDATORY;
import static com.hazelcast.internal.util.counters.MwCounter.newMwCounter;
import static com.hazelcast.util.ConcurrencyUtil.getOrPutIfAbsent;
import static com.hazelcast.util.FutureUtil.logAllExceptions;
import static com.hazelcast.util.ExceptionUtil.peel;
import static com.hazelcast.util.FutureUtil.waitWithDeadline;
import static com.hazelcast.util.Preconditions.checkNotNull;
import static java.util.logging.Level.FINEST;
import static java.util.logging.Level.WARNING;

public class ProxyServiceImpl
implements InternalProxyService, PostJoinAwareService,
EventPublishingService<DistributedObjectEventPacket, Object>, MetricsProvider {

public static final String SERVICE_NAME = "hz:core:proxyService";

private static final ExceptionHandler DESTROY_PROXY_EXCEPTION_HANDLER = logAllExceptions(Level.WARNING);
private final ExceptionHandler DESTROY_PROXY_EXCEPTION_HANDLER = new ExceptionHandler() {
@Override
public void handleException(Throwable throwable) {
boolean causedByInactiveInstance = peel(throwable) instanceof HazelcastInstanceNotActiveException;
Level level = causedByInactiveInstance ? FINEST : WARNING;
logger.log(level, "Error while destroying a proxy.", throwable);
}
};

private static final int TRY_COUNT = 10;
private static final long DESTROY_TIMEOUT_SECONDS = 30;
Expand Down

0 comments on commit a6b6fdf

Please sign in to comment.