public boolean processResponses(NodeListener listener) {
        boolean processedAnyResponses = false;
        long currentTime = timer.getCurrentTimeInMillis();
        synchronized(monitor) {
            for(GetNodeStateRequest req : replies) {
                processedAnyResponses = true;
                NodeInfo info = req.getNodeInfo();

                if (!info.isPendingGetNodeStateRequest(req)) {
                    log.log(Level.FINE, () -> "Ignoring getnodestate response from " + info.getNode()
                            + " as request replied to is not the most recent pending request.");
                    continue;
                }

                info.removePendingGetNodeStateRequest(req);

                GetNodeStateRequest.Reply reply = req.getReply();

                if (reply.isError()) {
                    if (reply.getReturnCode() != ErrorCode.ABORT) {
                        NodeState newState = handleError(req, info, currentTime);
                        if (newState != null) {
                            listener.handleNewNodeState(info, newState.clone());
                            info.setReportedState(newState, currentTime);
                        } else {
                            log.log(Level.FINE, () -> "Ignoring get node state error. Need to resend");
                        }
                    } else {
                        log.log(Level.FINE, () -> "Ignoring getnodestate response from " + info.getNode() + " as it was aborted by client");
                    }

                    continue;
                }

                try {
                    NodeState state = NodeState.deserialize(info.getNode().getType(), reply.getStateString());

                    // For version 0 responses, we poll, so we likely have not altered the state
                    if ( ! state.equals(info.getReportedState()))
                        listener.handleNewNodeState(info, state.clone());
                    info.setReportedState(state, currentTime);
                } catch (Exception e) {
                    log.log(Level.WARNING, "Failed to process get node state response", e);
                    info.setReportedState(new NodeState(info.getNode().getType(), DOWN), currentTime);
                }

                // Important: The old host info should be accessible in info.getHostInfo(), see interface.
                // Therefore, setHostInfo() must be called AFTER handleUpdatedHostInfo().
                HostInfo hostInfo = HostInfo.createHostInfo(reply.getHostInfo());
                listener.handleUpdatedHostInfo(info, hostInfo);
                info.setHostInfo(hostInfo);

            }
            replies.clear();
        }
        return processedAnyResponses;
    }
Reads replies to get node state requests and create events.
clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/NodeStateGatherer.java