dsmiley commented on code in PR #3713:
URL: https://github.com/apache/solr/pull/3713#discussion_r2403328565


##########
solr/solrj-zookeeper/src/java/org/apache/solr/client/solrj/impl/NodeValueFetcher.java:
##########
@@ -197,10 +173,12 @@ private void getRemoteMetricsFromTags(
       SimpleSolrResponse rsp =
           ctx.cloudSolrClient.getHttpClient().requestWithBaseUrl(baseUrl, 
req::process);
 
-      for (Metrics t : requestedMetricNames) {
-        Object value = t.extractResult(rsp.getResponse());
-        if (value != null) {
-          ctx.tags.put(t.tagName, value);
+      try (InputStream prometheusStream = (InputStream) 
rsp.getResponse().get(STREAM_KEY)) {
+        for (Metrics t : requestedMetricNames) {
+          Object value = t.extractFromPrometheus(prometheusStream);

Review Comment:
   this looks impossible... you're looping over requestedMetricNames and will 
consume from the stream additional times!  Additional attempts will silently 
see nothing.  It's like we need to two stream consumers that process the same 
lines.  Maybe you should pass requestedMetricNames to extractFromPrometheus.
   
   Did we have a test that would have caught that?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to