CaoManhDat commented on a change in pull request #1470: URL: https://github.com/apache/lucene-solr/pull/1470#discussion_r418416881
########## File path: solr/solrj/src/java/org/apache/solr/client/solrj/impl/Http2SolrClient.java ########## @@ -359,65 +366,95 @@ public void send(OutStream outStream, SolrRequest req, String collection) throws outStream.flush(); } - public NamedList<Object> request(SolrRequest solrRequest, - String collection, - OnComplete onComplete) throws IOException, SolrServerException { - Request req = makeRequest(solrRequest, collection); + private static final Exception CANCELLED_EXCEPTION = new Exception(); + + public Cancellable asyncRequest(SolrRequest solrRequest, String collection, OnComplete onComplete) { + Request req; + try { + req = makeRequest(solrRequest, collection); + } catch (SolrServerException | IOException e) { + onComplete.onFailure(e); + return () -> {}; Review comment: +1 ---------------------------------------------------------------- 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