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


##########
solr/core/src/java/org/apache/solr/handler/RequestHandlerBase.java:
##########
@@ -343,4 +343,16 @@ public Collection<Api> getApis() {
     return Collections.singleton(
         new ApiBag.ReqHandlerToApi(this, ApiBag.constructSpec(pluginInfo)));
   }
+
+  /**
+   * Checks whether the given request is an internal request to a shard. We 
rely on the fact that an
+   * internal search request to a shard contains the param "isShard", and an 
internal update request
+   * to a shard contains the param "distrib.from".
+   *
+   * @return true if request is internal
+   */
+  public static boolean isInternalShardRequest(SolrQueryRequest req) {

Review Comment:
   We have something called Rate Limiters in Solr too, and they rely on [some 
other 
mechanism](https://github.com/apache/solr/blob/main/solr/core/src/java/org/apache/solr/servlet/RateLimitManager.java#L82-L86)
 for determining internal vs external request, but I found no obvious way to 
re-use that here. So this param checking is a very naiive approach, but perhaps 
robust enough?



-- 
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: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to