rishisankar commented on a change in pull request #1770: URL: https://github.com/apache/lucene-solr/pull/1770#discussion_r476924185
########## File path: solr/core/src/java/org/apache/solr/handler/component/HttpShardHandler.java ########## @@ -156,36 +155,31 @@ public void submit(final ShardRequest sreq, final String shard, final Modifiable return; } - // all variables that set inside this listener must be at least volatile - responseCancellableMap.put(srsp, this.lbClient.asyncReq(lbReq, new AsyncListener<>() { - volatile long startTime = System.nanoTime(); - - @Override - public void onStart() { - if (tracer != null && span != null) { - tracer.inject(span.context(), Format.Builtin.HTTP_HEADERS, new SolrRequestCarrier(req)); - } - SolrRequestInfo requestInfo = SolrRequestInfo.getRequestInfo(); - if (requestInfo != null) req.setUserPrincipal(requestInfo.getReq().getUserPrincipal()); - } + long startTime = System.nanoTime(); + if (tracer != null && span != null) { Review comment: I think they're the same thread? In the previous implementation, the same thread that calls `submit()` [calls the async request method](https://github.com/apache/lucene-solr/blob/master/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandler.java#L160) and then within the async request method [calls `onStart()`](https://github.com/apache/lucene-solr/blob/master/solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttp2SolrClient.java#L89) - so it seems to me like previously the thread that called `submit()` and `onStart()` are the same. ---------------------------------------------------------------- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org