final long timeout = OGlobalConfiguration.DISTRIBUTED_ASYNCH_RESPONSES_TIMEOUT.getValueAsLong();
for (Iterator<Entry<Long, ODistributedResponseManager>> it = responsesByRequestIds.entrySet().iterator(); it.hasNext();) {
final Entry<Long, ODistributedResponseManager> item = it.next();
final ODistributedResponseManager resp = item.getValue();
final long timeElapsed = now - resp.getSentOn();
if (timeElapsed > timeout) {
// EXPIRED REQUEST, FREE IT!
final List<String> missingNodes = resp.getMissingNodes();
ODistributedServerLog.warn(this, manager.getLocalNodeName(), missingNodes.toString(), DIRECTION.IN,
"%d missed response(s) for message %d by nodes %s after %dms when timeout is %dms", missingNodes.size(),
resp.getMessageId(), missingNodes, timeElapsed, timeout);
Orient
.instance()
.getProfiler()
.updateCounter("distributed.db." + resp.getDatabaseName() + ".timeouts", "Number of messages in timeouts", +1,
"distributed.db.*.timeouts");
Orient.instance().getProfiler()
.updateCounter("distributed.node.timeouts", "Number of messages in timeouts", +1, "distributed.node.timeouts");
resp.timeout();
it.remove();
}
}
}