janhoy commented on code in PR #1871:
URL: https://github.com/apache/solr/pull/1871#discussion_r1309302038


##########
solr/core/src/java/org/apache/solr/handler/ContentStreamHandlerBase.java:
##########
@@ -63,6 +70,17 @@ public void handleRequestBody(SolrQueryRequest req, 
SolrQueryResponse rsp) throw
           SolrException.ErrorCode.SERVER_ERROR,
           "Updates are temporarily paused for core: " + 
req.getCore().getName());
     }
+    List<CircuitBreaker> trippedCircuitBreakers =
+        
req.getCore().getCircuitBreakerRegistry().checkTripped(RequestType.UPDATE);
+    if (trippedCircuitBreakers != null) {
+      String errorMessage = 
CircuitBreakerRegistry.toErrorMessage(trippedCircuitBreakers);
+      rsp.add(STATUS, FAILURE);
+      rsp.setException(
+          new SolrException(
+              SolrException.ErrorCode.SERVICE_UNAVAILABLE,
+              "Circuit Breakers tripped " + errorMessage));
+      return;

Review Comment:
   Placed it on top before registering.



-- 
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