atris commented on a change in pull request #1686:
URL: https://github.com/apache/lucene-solr/pull/1686#discussion_r464892774
##########
File path: solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
##########
@@ -377,6 +385,20 @@ public void doFilter(ServletRequest _request,
ServletResponse _response, FilterC
}
}
+ try {
+ accepted = rateLimitManager.handleRequest(request);
+ } catch (InterruptedException e) {
+ throw new SolrException(ErrorCode.SERVER_ERROR, e.getMessage());
+ }
+
+ if (!accepted) {
+ String errorMessage = "Too many requests for this request type." +
+ "Please try after some time or increase the quota for this request
type";
+
+ response.sendError(429, errorMessage);
+ //throw new SolrException(ErrorCode.TOO_MANY_REQUESTS, "FOOFOOOFOO");
Review comment:
Good catch, thanks!
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]