Program: 82179
Project: 82179
Buggy source:
public DistributedIndexServer(Configuration configuration,ZooKeeper zookeeper,ClusterStatus clusterStatus,BlurFilterCache filterCache,BlockCacheDirectoryFactory blockCacheDirectoryFactory,DistributedLayoutFactory distributedLayoutFactory,String cluster,String nodeName,long safeModeDelay,int shardOpenerThreadCount,int maxMergeThreads,int internalSearchThreads,int minimumNumberOfNodesBeforeExitingSafeMode,Timer hdfsKeyValueTimer,Timer indexImporterTimer,long smallMergeThreshold) throws KeeperException, InterruptedException {
  super(clusterStatus,configuration,nodeName,cluster);
  _indexImporterTimer=indexImporterTimer;
  _hdfsKeyValueTimer=hdfsKeyValueTimer;
  _minimumNumberOfNodes=minimumNumberOfNodesBeforeExitingSafeMode;
  _running.set(true);
  _closer=Closer.create();
  _shardOpenerThreadCount=shardOpenerThreadCount;
  _zookeeper=zookeeper;
  _filterCache=filterCache;
  _safeModeDelay=safeModeDelay;
  _internalSearchThreads=internalSearchThreads;
  _blockCacheDirectoryFactory=blockCacheDirectoryFactory;
  _distributedLayoutFactory=distributedLayoutFactory;
  _closer.register(_shardStateManager);
  BlurUtil.setupZookeeper(_zookeeper,_cluster);
  _openerService=Executors.newThreadPool("String_Node_Str",_shardOpenerThreadCount);
  _searchExecutor=Executors.newThreadPool("String_Node_Str",_internalSearchThreads);
  _closer.register(CloseableExecutorService.close(_openerService));
  _closer.register(CloseableExecutorService.close(_searchExecutor));
  _mergeScheduler=_closer.register(new SharedMergeScheduler(maxMergeThreads,smallMergeThreshold));
  _indexCloser=_closer.register(new BlurIndexCloser());
  _timerCacheFlush=setupFlushCacheTimer();
  _timerCacheFlush.start();
  String onlineShardsPath=ZookeeperPathConstants.getOnlineShardsPath(_cluster);
  String safemodePath=ZookeeperPathConstants.getSafemodePath(_cluster);
  int registerNodeTimeOut=_zookeeper.getSessionTimeout() / 1000 + 4;
  SafeMode safeMode=new SafeMode(_zookeeper,safemodePath,onlineShardsPath,TimeUnit.MILLISECONDS,_safeModeDelay,TimeUnit.SECONDS,registerNodeTimeOut,_minimumNumberOfNodes);
  safeMode.registerNode(getNodeName(),BlurUtil.getVersion().getBytes());
  _timerTableWarmer=setupTableWarmer();
  _timerTableWarmer.start();
  _watchOnlineShards=watchForShardServerChanges();
  _clusterStatus.registerActionOnTableStateChange(new Action(){
    @Override public void action(){
synchronized (_warmupLock) {
        _warmupLock.notifyAll();
      }
    }
  }
);
  _clusterStatus.registerActionOnTableStateChange(new Action(){
    @Override public void action(){
synchronized (_cleanupLock) {
        _cleanupLock.notifyAll();
      }
    }
  }
);
}

Fixed version (ground truth):
public DistributedIndexServer(Configuration configuration,ZooKeeper zookeeper,ClusterStatus clusterStatus,BlurFilterCache filterCache,BlockCacheDirectoryFactory blockCacheDirectoryFactory,DistributedLayoutFactory distributedLayoutFactory,String cluster,String nodeName,long safeModeDelay,int shardOpenerThreadCount,int maxMergeThreads,int internalSearchThreads,int minimumNumberOfNodesBeforeExitingSafeMode,Timer hdfsKeyValueTimer,Timer indexImporterTimer,long smallMergeThreshold,Timer indexBulkTimer) throws KeeperException, InterruptedException {
  super(clusterStatus,configuration,nodeName,cluster);
  _indexImporterTimer=indexImporterTimer;
  _indexBulkTimer=indexBulkTimer;
  _hdfsKeyValueTimer=hdfsKeyValueTimer;
  _minimumNumberOfNodes=minimumNumberOfNodesBeforeExitingSafeMode;
  _running.set(true);
  _closer=Closer.create();
  _shardOpenerThreadCount=shardOpenerThreadCount;
  _zookeeper=zookeeper;
  _filterCache=filterCache;
  _safeModeDelay=safeModeDelay;
  _internalSearchThreads=internalSearchThreads;
  _blockCacheDirectoryFactory=blockCacheDirectoryFactory;
  _distributedLayoutFactory=distributedLayoutFactory;
  _closer.register(_shardStateManager);
  BlurUtil.setupZookeeper(_zookeeper,_cluster);
  _openerService=Executors.newThreadPool("String_Node_Str",_shardOpenerThreadCount);
  _searchExecutor=Executors.newThreadPool("String_Node_Str",_internalSearchThreads);
  _closer.register(CloseableExecutorService.close(_openerService));
  _closer.register(CloseableExecutorService.close(_searchExecutor));
  _mergeScheduler=_closer.register(new SharedMergeScheduler(maxMergeThreads,smallMergeThreshold));
  _indexCloser=_closer.register(new BlurIndexCloser());
  _timerCacheFlush=setupFlushCacheTimer();
  _timerCacheFlush.start();
  String onlineShardsPath=ZookeeperPathConstants.getOnlineShardsPath(_cluster);
  String safemodePath=ZookeeperPathConstants.getSafemodePath(_cluster);
  int registerNodeTimeOut=_zookeeper.getSessionTimeout() / 1000 + 4;
  SafeMode safeMode=new SafeMode(_zookeeper,safemodePath,onlineShardsPath,TimeUnit.MILLISECONDS,_safeModeDelay,TimeUnit.SECONDS,registerNodeTimeOut,_minimumNumberOfNodes);
  safeMode.registerNode(getNodeName(),BlurUtil.getVersion().getBytes());
  _timerTableWarmer=setupTableWarmer();
  _timerTableWarmer.start();
  _watchOnlineShards=watchForShardServerChanges();
  _clusterStatus.registerActionOnTableStateChange(new Action(){
    @Override public void action(){
synchronized (_warmupLock) {
        _warmupLock.notifyAll();
      }
    }
  }
);
  _clusterStatus.registerActionOnTableStateChange(new Action(){
    @Override public void action(){
synchronized (_cleanupLock) {
        _cleanupLock.notifyAll();
      }
    }
  }
);
}