mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-16 18:02:05 +02:00
Suppressing some error messages that pollute the log on switch disconnect.
Change-Id: Ia79e0efcdf8552a4be1ce6b6cb562100f077bd90
This commit is contained in:
parent
0a4c27015a
commit
e9af1f44a4
@ -80,6 +80,10 @@ import org.slf4j.LoggerFactory;
|
|||||||
*/
|
*/
|
||||||
class OFChannelHandler extends IdleStateAwareChannelHandler {
|
class OFChannelHandler extends IdleStateAwareChannelHandler {
|
||||||
private static final Logger log = LoggerFactory.getLogger(OFChannelHandler.class);
|
private static final Logger log = LoggerFactory.getLogger(OFChannelHandler.class);
|
||||||
|
|
||||||
|
private static final String RESET_BY_PEER = "Connection reset by peer";
|
||||||
|
private static final String BROKEN_PIPE = "Broken pipe";
|
||||||
|
|
||||||
private final Controller controller;
|
private final Controller controller;
|
||||||
private OpenFlowSwitchDriver sw;
|
private OpenFlowSwitchDriver sw;
|
||||||
private long thisdpid; // channelHandler cached value of connected switch id
|
private long thisdpid; // channelHandler cached value of connected switch id
|
||||||
@ -1094,11 +1098,14 @@ class OFChannelHandler extends IdleStateAwareChannelHandler {
|
|||||||
} else if (e.getCause() instanceof ClosedChannelException) {
|
} else if (e.getCause() instanceof ClosedChannelException) {
|
||||||
log.debug("Channel for sw {} already closed", getSwitchInfoString());
|
log.debug("Channel for sw {} already closed", getSwitchInfoString());
|
||||||
} else if (e.getCause() instanceof IOException) {
|
} else if (e.getCause() instanceof IOException) {
|
||||||
log.error("Disconnecting switch {} due to IO Error: {}",
|
if (!e.getCause().getMessage().equals(RESET_BY_PEER) &&
|
||||||
getSwitchInfoString(), e.getCause().getMessage());
|
!e.getCause().getMessage().equals(BROKEN_PIPE)) {
|
||||||
if (log.isDebugEnabled()) {
|
log.error("Disconnecting switch {} due to IO Error: {}",
|
||||||
// still print stack trace if debug is enabled
|
getSwitchInfoString(), e.getCause().getMessage());
|
||||||
log.debug("StackTrace for previous Exception: ", e.getCause());
|
if (log.isDebugEnabled()) {
|
||||||
|
// still print stack trace if debug is enabled
|
||||||
|
log.debug("StackTrace for previous Exception: ", e.getCause());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ctx.getChannel().close();
|
ctx.getChannel().close();
|
||||||
} else if (e.getCause() instanceof SwitchStateException) {
|
} else if (e.getCause() instanceof SwitchStateException) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user