[ 
https://issues.apache.org/jira/browse/SOLR-17983?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated SOLR-17983:
----------------------------------
    Labels: pull-request-available  (was: )

> ParallelHttpShardHandler misuses Java future APIs, causing distributed 
> requests to hang indefinitely.
> -----------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-17983
>                 URL: https://issues.apache.org/jira/browse/SOLR-17983
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Mark Robert Miller
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> ParallelHttpShardHandler incorrectly composes FutureTask with 
> CompletableFuture, resulting in lost exceptions and hanging distributed 
> requests.
>  
> During shard submission, {{ParallelHttpShardHandler}} wraps each 
> {{makeShardRequest}} invocation inside a {{{}FutureTask{}}}, and then runs 
> that task via {{{}CompletableFuture.runAsync{}}}. The intent is to submit 
> shard requests asynchronously and record their completion or failure using a 
> {{whenComplete}} handler.
> However, {{FutureTask.run()}} *captures exceptions internally* rather than 
> throwing them. When it’s executed inside {{{}CompletableFuture.runAsync{}}}, 
> the enclosing {{CompletableFuture}} cannot detect that a failure occurred, 
> because {{runAsync}} only completes exceptionally when the submitted 
> {{Runnable}} throws.
> As a result, if {{super.makeShardRequest(...)}} throws an exception:
>  * The {{FutureTask}} records the exception internally.
>  * The {{CompletableFuture}} completes _successfully_ (no exception 
> propagated).
>  * The {{whenComplete}} callback receives a {{null}} {{{}Throwable{}}}, so 
> the error handler ({{{}recordShardSubmitError{}}}) is never called.
>  * The shard response is never recorded.
>  * The coordinating request waits indefinitely for a shard response that will 
> never arrive.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to