Buggy code:
public class OverseerCollectionProcessor implements Runnable , ClosableThread { public static final String NUM_SLICES = "numShards" ; public static final String REPLICATION_FACTOR = "replicationFactor" ; public static final String MAX_SHARDS_PER_NODE = "maxShardsPerNode" ; public static final String CREATE_NODE_SET = "createNodeSet" ; public static final String DELETECOLLECTION = "deletecollection" ; public static final String CREATECOLLECTION = "createcollection" ; public static final String RELOADCOLLECTION = "reloadcollection" ; public static final String CREATEALIAS = "createalias" ; public static final String DELETEALIAS = "deletealias" ; public static final String SPLITSHARD = "splitshard" ; public static final String DELETESHARD = "deleteshard" ; public static final String ROUTER = "router" ; public static final String SHARDS_PROP = "shards" ; public static final String CREATESHARD = "createshard" ; public static final String DELETEREPLICA = "deletereplica" ; public static final String MIGRATE = "migrate" ; public static final String COLL_CONF = "collection.configName" ; public static final String COLL_PROP_PREFIX = "property." ; public static final Map < String , Object > COLL_PROPS = ZkNodeProps . makeMap ( OverseerCollectionProcessor . ROUTER , DEFAULT_NAME , OverseerCollectionProcessor . REPLICATION_FACTOR , "1" , OverseerCollectionProcessor . MAX_SHARDS_PER_NODE , "1" , "external" , null ) ; private static final String QUEUE_OPERATION = "operation" ; private static Logger log = LoggerFactory . getLogger ( OverseerCollectionProcessor . class ) ; private DistributedQueue workQueue ; private String myId ; private ShardHandler shardHandler ; private String adminPath ; private ZkStateReader zkStateReader ; private boolean isClosed ; public OverseerCollectionProcessor ( ZkStateReader zkStateReader , String myId , ShardHandler shardHandler , String adminPath ) { } protected OverseerCollectionProcessor ( ZkStateReader zkStateReader , String myId , ShardHandler shardHandler , String adminPath , DistributedQueue workQueue ) { } @ Override public void run ( ) { } public void close ( ) { } private void prioritizeOverseerNodes ( ) throws InterruptedException , KeeperException { } public static List < String > getSortedNodeNames ( SolrZkClient zk ) throws InterruptedException , KeeperException { } private void invokeRejoinOverseer ( String nodeName ) { } public static String getLeaderNode ( SolrZkClient client ) throws InterruptedException , KeeperException { } protected LeaderStatus amILeader ( ) { } protected SolrResponse processMessage ( ZkNodeProps message , String operation ) { } private void processRoleCommand ( ZkNodeProps message , String operation ) throws InterruptedException , KeeperException { } private void deleteReplica ( ClusterState clusterState , ZkNodeProps message , NamedList results ) throws InterruptedException , KeeperException { } private boolean waitForCoreNodeGone ( String collectionName , String shard , String replicaName , int timeoutms ) throws InterruptedException { } private void deleteCoreNode ( String collectionName , String replicaName , Replica replica , String core ) throws InterruptedException , KeeperException { } private void checkRequired ( ZkNodeProps message , String ... props ) { } private void deleteCollection ( ZkNodeProps message , NamedList results ) throws InterruptedException , KeeperException { String collection = message . getStr ( "name" ) ; try { ModifiableSolrParams params = new ModifiableSolrParams ( ) ; params . set ( ACTION , UNLOAD . toString ( ) ) ; params . set ( DELETE_INSTANCE_DIR , true ) ; params . set ( DELETE_DATA_DIR , true ) ; collectionCmd ( zkStateReader . getClusterState ( ) , message , params , results , null ) ; ZkNodeProps m = new ZkNodeProps ( Overseer . QUEUE_OPERATION , Overseer . REMOVECOLLECTION , "name" , collection ) ; Overseer . getInQueue ( zkStateReader . getZkClient ( ) ) . offer ( ZkStateReader . toJSON ( m ) ) ; long now = System . currentTimeMillis ( ) ; long timeout = now + 30000 ; boolean removed = false ; while ( ( System . currentTimeMillis ( ) ) < timeout ) { Thread . sleep ( 100 ) ; removed = ! ( zkStateReader . getClusterState ( ) . hasCollection ( message . getStr ( collection ) ) ) ; if ( removed ) { <START_BUG> Thread . sleep ( 100 ) ; <END_BUG> break ; } } if ( ! removed ) { throw new SolrException ( ErrorCode . SERVER_ERROR , ( "Could<seq2seq4repair_space>not<seq2seq4repair_space>fully<seq2seq4repair_space>remove<seq2seq4repair_space>collection:<seq2seq4repair_space>" + ( message . getStr ( "name" ) ) ) ) ; } } finally { try { if ( zkStateReader . getZkClient ( ) . exists ( ( ( ( ZkStateReader . COLLECTIONS_ZKNODE ) + "//" ) + collection ) , true ) ) { zkStateReader . getZkClient ( ) . clean ( ( ( ( ZkStateReader . COLLECTIONS_ZKNODE ) + "//" ) + collection ) ) ; } } catch ( InterruptedException e ) { SolrException . log ( OverseerCollectionProcessor . log , ( "Cleaning<seq2seq4repair_space>up<seq2seq4repair_space>collection<seq2seq4repair_space>in<seq2seq4repair_space>zk<seq2seq4repair_space>was<seq2seq4repair_space>interrupted:" + collection ) , e ) ; Thread . currentThread ( ) . interrupt ( ) ; } catch ( KeeperException e ) { SolrException . log ( OverseerCollectionProcessor . log , ( "Problem<seq2seq4repair_space>cleaning<seq2seq4repair_space>up<seq2seq4repair_space>collection<seq2seq4repair_space>in<seq2seq4repair_space>zk:" + collection ) , e ) ; } } } private void createAlias ( Aliases aliases , ZkNodeProps message ) { } private void checkForAlias ( String name , String value ) { } private void checkForAliasAbsence ( String name ) { } private void deleteAlias ( Aliases aliases , ZkNodeProps message ) { } private boolean createShard ( ClusterState clusterState , ZkNodeProps message , NamedList results ) throws InterruptedException , KeeperException { } private boolean splitShard ( ClusterState clusterState , ZkNodeProps message , NamedList results ) { } private void commit ( NamedList results , String slice , Replica parentShardLeader ) { } static UpdateResponse softCommit ( String url ) throws IOException , SolrServerException { } private String waitForCoreNodeName ( DocCollection collection , String msgBaseUrl , String msgCore ) { } private void collectShardResponses ( NamedList results , boolean abortOnError , String msgOnError ) { } private void deleteShard ( ClusterState clusterState , ZkNodeProps message , NamedList results ) { } private void migrate ( ClusterState clusterState , ZkNodeProps message , NamedList results ) throws InterruptedException , KeeperException { }

Fix:
Thread . sleep ( 300 ) ;