Jonathan Hart
Committed by Gerrit Code Review

Protect against exceptions thrown in application's packet processors.

These exceptions should not bubble up to netty because that will result in the
connection to the switch being closed.

For now we catch and log the exception - in the future we could consider removing
misbehaving packet processors.

Addresses ONOS-3368.

Change-Id: If507adafba39bf705c27286c8e48af3f955d1eff
......@@ -312,9 +312,13 @@ public class PacketManager
public void processPacket(PacketContext context) {
// TODO filter packets sent to processors based on registrations
for (ProcessorEntry entry : processors) {
long start = System.nanoTime();
entry.processor().process(context);
entry.addNanos(System.nanoTime() - start);
try {
long start = System.nanoTime();
entry.processor().process(context);
entry.addNanos(System.nanoTime() - start);
} catch (Exception e) {
log.warn("Packet processor {} threw an exception", entry.processor(), e);
}
}
}
......