Fix AdaptiveSelectionStats serialization bug (#28718)
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
This commit is contained in:
parent
df07943522
commit
c0026648f0
|
@ -95,10 +95,6 @@ public class SearchTransportService extends AbstractComponent {
|
|||
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>() {
|
||||
|
|
|
@ -121,7 +121,7 @@ public class NodeService extends AbstractComponent implements Closeable {
|
|||
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
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue