make sure we wrap a potential failure in sending master state change in a catch

This commit is contained in:
Shay Banon 2013-07-30 16:44:30 +02:00
parent 668d55758b
commit 33d8571d1e
1 changed files with 7 additions and 3 deletions

View File

@ -178,14 +178,14 @@ public class IndicesClusterStateService extends AbstractLifecycleComponent<Indic
try { try {
nodeIndexCreatedAction.nodeIndexCreated(index, event.state().nodes().localNodeId()); nodeIndexCreatedAction.nodeIndexCreated(index, event.state().nodes().localNodeId());
} catch (Exception e) { } catch (Exception e) {
logger.debug("failed to send to master index {} created event", index); logger.debug("failed to send to master index {} created event", e, index);
} }
} }
for (String index : event.indicesDeleted()) { for (String index : event.indicesDeleted()) {
try { try {
nodeIndexDeletedAction.nodeIndexDeleted(index, event.state().nodes().localNodeId()); nodeIndexDeletedAction.nodeIndexDeleted(index, event.state().nodes().localNodeId());
} catch (Exception e) { } catch (Exception e) {
logger.debug("failed to send to master index {} deleted event", index); logger.debug("failed to send to master index {} deleted event", e, index);
} }
} }
} }
@ -193,7 +193,11 @@ public class IndicesClusterStateService extends AbstractLifecycleComponent<Indic
private void notifyIndicesStateChanged(final ClusterChangedEvent event) { private void notifyIndicesStateChanged(final ClusterChangedEvent event) {
//handles open/close index notifications //handles open/close index notifications
if (event.indicesStateChanged()) { if (event.indicesStateChanged()) {
nodeIndicesStateUpdatedAction.nodeIndexStateUpdated(new NodeIndicesStateUpdatedAction.NodeIndexStateUpdatedResponse(event.state().nodes().localNodeId(), event.state().version())); try {
nodeIndicesStateUpdatedAction.nodeIndexStateUpdated(new NodeIndicesStateUpdatedAction.NodeIndexStateUpdatedResponse(event.state().nodes().localNodeId(), event.state().version()));
} catch (Exception e) {
logger.debug("failed to send to master indices state change event", e);
}
} }
} }