Skip to content

Commit

Permalink
Fix AdaptiveSelectionStats serialization bug (#28718)
Browse files Browse the repository at this point in the history
The AdaptiveSelectionStats object serializes the clientOutgoingConnections map that's concurrently updated in SearchTransportService. Serializing the map consists of first writing the size of the map and then serializing the entries. If the number of entries changes while the map is being serialized, the size and number of entries go out of sync. The deserialization routine expects those to be in sync though.

Closes #28713
  • Loading branch information
ywelsch committed Feb 19, 2018
1 parent d8602bc commit 66a8f7d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@ public SearchTransportService(Settings settings, TransportService transportServi
this.responseWrapper = responseWrapper;
}

public Map<String, Long> getClientConnections() {
return Collections.unmodifiableMap(clientConnections);
}

public void sendFreeContext(Transport.Connection connection, final long contextId, OriginalIndices originalIndices) {
transportService.sendRequest(connection, FREE_CONTEXT_ACTION_NAME, new SearchFreeContextRequest(originalIndices, contextId),
TransportRequestOptions.EMPTY, new ActionListenerResponseHandler<>(new ActionListener<SearchFreeContextResponse>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public NodeStats stats(CommonStatsFlags indices, boolean os, boolean process, bo
script ? scriptService.stats() : null,
discoveryStats ? discovery.stats() : null,
ingest ? ingestService.getPipelineExecutionService().stats() : null,
adaptiveSelection ? responseCollectorService.getAdaptiveStats(searchTransportService.getClientConnections()) : null
adaptiveSelection ? responseCollectorService.getAdaptiveStats(searchTransportService.getPendingSearchRequests()) : null
);
}

Expand Down

0 comments on commit 66a8f7d

Please sign in to comment.