Program: 82071
Project: 82071
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,Timer indexBulkTimer,ThriftCache thriftCache,SequentialReadControl sequentialReadControl) throws KeeperException, InterruptedException {
  super(clusterStatus,configuration,nodeName,cluster);
  _sequentialReadControl=sequentialReadControl;
  _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;
  _thriftCache=thriftCache;
  _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,ThriftCache thriftCache,SequentialReadControl sequentialReadControl,Timer indexIdleWriterTimer,long maxWriterIdle) throws KeeperException, InterruptedException {
  super(clusterStatus,configuration,nodeName,cluster);
  _indexIdleWriterTimer=indexIdleWriterTimer;
  _maxWriterIdle=maxWriterIdle;
  _sequentialReadControl=sequentialReadControl;
  _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;
  _thriftCache=thriftCache;
  _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();
      }
    }
  }
);
}