Buggy code:
public class HttpShardHandler extends ShardHandler { private HttpShardHandlerFactory httpShardHandlerFactory ; private CompletionService < ShardResponse > completionService ; private Set < Future < ShardResponse > > pending ; private Map < String , List < String > > shardToURLs ; private HttpClient httpClient ; public HttpShardHandler ( HttpShardHandlerFactory httpShardHandlerFactory , HttpClient httpClient ) { } private static class SimpleSolrResponse extends SolrResponse { long elapsedTime ; NamedList < Object > nl ; @ Override public long getElapsedTime ( ) { } @ Override public NamedList < Object > getResponse ( ) { } @ Override public void setResponse ( NamedList < Object > rsp ) { } } private List < String > getURLs ( String shard ) { } @ Override public void submit ( final ShardRequest sreq , final String shard , final ModifiableSolrParams params ) { final List < String > urls = getURLs ( shard ) ; Callable < ShardResponse > task = new Callable < ShardResponse > ( ) { @ Override public ShardResponse call ( ) throws Exception { ShardResponse srsp = new ShardResponse ( ) ; if ( ( sreq . nodeName ) != null ) { srsp . setNodeName ( sreq . nodeName ) ; } srsp . setShardRequest ( sreq ) ; srsp . setShard ( shard ) ; HttpShardHandler . SimpleSolrResponse ssr = new HttpShardHandler . SimpleSolrResponse ( ) ; srsp . setSolrResponse ( ssr ) ; long startTime = System . currentTimeMillis ( ) ; try { params . remove ( WT ) ; params . remove ( VERSION ) ; QueryRequest req = new QueryRequest ( params ) ; req . setMethod ( POST ) ; if ( ( urls . size ( ) ) == 0 ) { throw new SolrException ( ErrorCode . SERVICE_UNAVAILABLE , ( "no<seq2seq4repair_space>servers<seq2seq4repair_space>hosting<seq2seq4repair_space>shard:<seq2seq4repair_space>" + shard ) ) ; } if ( ( urls . size ( ) ) <= 1 ) { String url = urls . get ( 0 ) ; srsp . setShardAddress ( url ) ; SolrServer server = new org . apache . solr . client . solrj . impl . HttpSolrServer ( url , httpClient ) ; try { ssr . nl = server . request ( req ) ; } finally { server . shutdown ( ) ; } } else { LBHttpSolrServer . Rsp rsp = httpShardHandlerFactory . makeLoadBalancedRequest ( req , urls ) ; ssr . nl = rsp . getResponse ( ) ; srsp . setShardAddress ( rsp . getServer ( ) ) ; } } catch ( ConnectException cex ) { srsp . setException ( cex ) ; <START_BUG> } catch ( Throwable th ) { <END_BUG> srsp . setException ( th ) ; if ( th instanceof SolrException ) { srsp . setResponseCode ( ( ( SolrException ) ( th ) ) . code ( ) ) ; } else { srsp . setResponseCode ( ( - 1 ) ) ; } } ssr . elapsedTime = ( System . currentTimeMillis ( ) ) - startTime ; return srsp ; } } ; pending . add ( completionService . submit ( task ) ) ; } @ Override public ShardResponse takeCompletedIncludingErrors ( ) { } @ Override public ShardResponse takeCompletedOrError ( ) { } private ShardResponse take ( boolean bailOnError ) { } @ Override public void cancelAll ( ) { } @ Override public void checkDistributed ( ResponseBuilder rb ) { } private void addSlices ( Map < String , Slice > target , ClusterState state , SolrParams params , String collectionName , String shardKeys , boolean multiCollection ) { } }

Fix:
} catch ( Exception th ) {