mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-15 09:21:06 +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 {
|
||||
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 OpenFlowSwitchDriver sw;
|
||||
private long thisdpid; // channelHandler cached value of connected switch id
|
||||
@ -1094,11 +1098,14 @@ class OFChannelHandler extends IdleStateAwareChannelHandler {
|
||||
} else if (e.getCause() instanceof ClosedChannelException) {
|
||||
log.debug("Channel for sw {} already closed", getSwitchInfoString());
|
||||
} else if (e.getCause() instanceof IOException) {
|
||||
log.error("Disconnecting switch {} due to IO Error: {}",
|
||||
getSwitchInfoString(), e.getCause().getMessage());
|
||||
if (log.isDebugEnabled()) {
|
||||
// still print stack trace if debug is enabled
|
||||
log.debug("StackTrace for previous Exception: ", e.getCause());
|
||||
if (!e.getCause().getMessage().equals(RESET_BY_PEER) &&
|
||||
!e.getCause().getMessage().equals(BROKEN_PIPE)) {
|
||||
log.error("Disconnecting switch {} due to IO Error: {}",
|
||||
getSwitchInfoString(), e.getCause().getMessage());
|
||||
if (log.isDebugEnabled()) {
|
||||
// still print stack trace if debug is enabled
|
||||
log.debug("StackTrace for previous Exception: ", e.getCause());
|
||||
}
|
||||
}
|
||||
ctx.getChannel().close();
|
||||
} else if (e.getCause() instanceof SwitchStateException) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user