Fix for 4015 : wrong error messages when replication heart-beat fails
When the replication heart-beat fails, the replication disconnects from the
replication server and reconnect to another one.
In such case the error messages are too verbose and may lead to false conclusion.
This change reduce the error messages logged in those case.
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.replication.protocol; |
| | | |
| | |
| | | * @return The timestamp in milliseconds of the last message received. |
| | | */ |
| | | public abstract long getLastReceiveTime(); |
| | | |
| | | /** |
| | | * This methods allows to determine if the session close was initiated |
| | | * on this ProtocolSession. |
| | | * |
| | | * @return A boolean allowing to determine if the session close was initiated |
| | | * on this ProtocolSession. |
| | | */ |
| | | public abstract boolean closeInitiated(); |
| | | } |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.replication.protocol; |
| | | |
| | |
| | | */ |
| | | private long lastReceiveTime = 0; |
| | | |
| | | private boolean closeInitiated = false; |
| | | |
| | | |
| | | /** |
| | | * Creates a new SocketSession based on the provided socket. |
| | |
| | | */ |
| | | public void close() throws IOException |
| | | { |
| | | closeInitiated = true; |
| | | |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugInfo("Closing SocketSession." |
| | |
| | | { |
| | | socket.setSoTimeout(timeout); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean closeInitiated() |
| | | { |
| | | return closeInitiated; |
| | | } |
| | | } |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.replication.protocol; |
| | | |
| | |
| | | */ |
| | | private long lastReceiveTime = 0; |
| | | |
| | | private boolean closeInitiated = false; |
| | | |
| | | |
| | | /** |
| | | * Creates a new TLSSocketSession. |
| | |
| | | */ |
| | | public void close() throws IOException |
| | | { |
| | | closeInitiated = true; |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugInfo("Closing SocketSession." + |
| | |
| | | { |
| | | plainSocket.setSoTimeout(timeout); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean closeInitiated() |
| | | { |
| | | return closeInitiated; |
| | | } |
| | | } |
| | |
| | | { |
| | | if (shutdown == false) |
| | | { |
| | | Message message = |
| | | NOTE_DISCONNECTED_FROM_CHANGELOG.get(replicationServer, |
| | | Short.toString(rsServerId), baseDn.toString(), |
| | | Short.toString(serverId)); |
| | | logError(message); |
| | | |
| | | debugInfo("ReplicationBroker.receive() " + baseDn + |
| | | " Exception raised: " + e.getLocalizedMessage()); |
| | | if (!session.closeInitiated()) |
| | | { |
| | | /* |
| | | * If we did not initiate the close on our side, log a message. |
| | | */ |
| | | Message message = |
| | | NOTE_DISCONNECTED_FROM_CHANGELOG.get(replicationServer, |
| | | Short.toString(rsServerId), baseDn.toString(), |
| | | Short.toString(serverId)); |
| | | logError(message); |
| | | } |
| | | this.reStart(failingSession); |
| | | } |
| | | } |
| | |
| | | |
| | | private boolean debugEnabled() |
| | | { |
| | | return true; |
| | | return false; |
| | | } |
| | | |
| | | private static final void debugInfo(String s) |