Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
JENKINS-42611: don't throw exceptiosn in session cleanup (#19)
  • Loading branch information
tfennelly committed Mar 9, 2017
1 parent e40ff21 commit f911d2f
Showing 1 changed file with 13 additions and 5 deletions.
Expand Up @@ -381,13 +381,21 @@ public void onMessage(@Nonnull Message message) {
public static final class SSEHttpSessionListener extends HttpSessionListener {
@Override
public void sessionDestroyed(HttpSessionEvent httpSessionEvent) {
Map<String, EventDispatcher> dispatchers = EventDispatcherFactory.getDispatchers(httpSessionEvent.getSession());
try {
for (EventDispatcher dispatcher : dispatchers.values()) {
dispatcher.unsubscribeAll();
Map<String, EventDispatcher> dispatchers = EventDispatcherFactory.getDispatchers(httpSessionEvent.getSession());
try {
for (EventDispatcher dispatcher : dispatchers.values()) {
try {
dispatcher.unsubscribeAll();
} catch (Exception e) {
LOGGER.log(Level.FINE, "Error during unsubscribeAll() for dispatcher " + dispatcher.getId() + ".", e);
}
}
} finally {
dispatchers.clear();
}
} finally {
dispatchers.clear();
} catch (Exception e) {
LOGGER.log(Level.FINE, "Error during session cleanup. The session has probably timed out.", e);
}
}
}
Expand Down

0 comments on commit f911d2f

Please sign in to comment.