in src/main/java/com/googlesource/gerrit/plugins/events/StreamEvents.java [179:190]
public void destroy(ChannelSession channel) {
unsubscribe();
synchronized (crossThreadlock) {
boolean alreadyShuttingDown = shuttingDown;
shuttingDown = true;
if (isFlushing()) {
flusherTask.cancel(true);
} else if (!alreadyShuttingDown) {
onExit(0);
}
}
}