Program: 82523
Project: 82523
Buggy source:
public static void main(String[] args) throws TTransportException, IOException, KeeperException, InterruptedException, BlurException {
  int serverIndex=getServerIndex(args);
  LOG.info("String_Node_Str");
  Thread.setDefaultUncaughtExceptionHandler(new SimpleUncaughtExceptionHandler());
  BlurConfiguration configuration=new BlurConfiguration();
  String bindAddress=configuration.get(BLUR_CONTROLLER_BIND_ADDRESS);
  int bindPort=configuration.getInt(BLUR_CONTROLLER_BIND_PORT,-1);
  bindPort+=serverIndex;
  LOG.info("String_Node_Str",serverIndex,bindAddress + "String_Node_Str" + bindPort);
  Configuration config=new Configuration();
  BlurMetrics blurMetrics=new BlurMetrics(config);
  String nodeName=ThriftBlurShardServer.getNodeName(configuration,BLUR_CONTROLLER_HOSTNAME);
  nodeName=nodeName + "String_Node_Str" + bindPort;
  String zkConnectionStr=isEmpty(configuration.get(BLUR_ZOOKEEPER_CONNECTION),BLUR_ZOOKEEPER_CONNECTION);
  BlurQueryChecker queryChecker=new BlurQueryChecker(configuration);
  boolean crazyMode=false;
  if (args.length == 1 && args[1].equals(CRAZY)) {
    crazyMode=true;
  }
  final ZooKeeper zooKeeper=ZkUtils.newZooKeeper(zkConnectionStr);
  ZookeeperSystemTime.checkSystemTime(zooKeeper,configuration.getLong(BLUR_ZOOKEEPER_SYSTEM_TIME_TOLERANCE,3000));
  final ZookeeperClusterStatus clusterStatus=new ZookeeperClusterStatus(zooKeeper);
  BlurClient client=new BlurClientRemote();
  final BlurControllerServer controllerServer=new BlurControllerServer();
  controllerServer.setClient(client);
  controllerServer.setClusterStatus(clusterStatus);
  controllerServer.setZookeeper(zooKeeper);
  controllerServer.setNodeName(nodeName);
  controllerServer.setRemoteFetchCount(configuration.getInt(BLUR_CONTROLLER_REMOTE_FETCH_COUNT,100));
  controllerServer.setMaxQueryCacheElements(configuration.getInt(BLUR_CONTROLLER_CACHE_MAX_QUERYCACHE_ELEMENTS,128));
  controllerServer.setMaxTimeToLive(configuration.getLong(BLUR_CONTROLLER_CACHE_MAX_TIMETOLIVE,TimeUnit.MINUTES.toMillis(1)));
  controllerServer.setQueryChecker(queryChecker);
  controllerServer.setThreadCount(configuration.getInt(BLUR_CONTROLLER_SERVER_REMOTE_THREAD_COUNT,64));
  controllerServer.setMaxFetchRetries(configuration.getInt(BLUR_CONTROLLER_RETRY_MAX_FETCH_RETRIES,1));
  controllerServer.setMaxMutateRetries(configuration.getInt(BLUR_CONTROLLER_RETRY_MAX_MUTATE_RETRIES,1));
  controllerServer.setMaxDefaultRetries(configuration.getInt(BLUR_CONTROLLER_RETRY_MAX_DEFAULT_RETRIES,1));
  controllerServer.setFetchDelay(configuration.getInt(BLUR_CONTROLLER_RETRY_FETCH_DELAY,500));
  controllerServer.setMutateDelay(configuration.getInt(BLUR_CONTROLLER_RETRY_MUTATE_DELAY,500));
  controllerServer.setDefaultDelay(configuration.getInt(BLUR_CONTROLLER_RETRY_DEFAULT_DELAY,500));
  controllerServer.setMaxFetchDelay(configuration.getInt(BLUR_CONTROLLER_RETRY_MAX_FETCH_DELAY,2000));
  controllerServer.setMaxMutateDelay(configuration.getInt(BLUR_CONTROLLER_RETRY_MAX_MUTATE_DELAY,2000));
  controllerServer.setMaxDefaultDelay(configuration.getInt(BLUR_CONTROLLER_RETRY_MAX_DEFAULT_DELAY,2000));
  controllerServer.init();
  Iface iface=BlurUtil.recordMethodCallsAndAverageTimes(blurMetrics,controllerServer,Iface.class);
  int threadCount=configuration.getInt(BLUR_CONTROLLER_SERVER_THRIFT_THREAD_COUNT,32);
  final ThriftBlurControllerServer server=new ThriftBlurControllerServer();
  server.setNodeName(nodeName);
  server.setConfiguration(configuration);
  server.setBindAddress(bindAddress);
  server.setBindPort(bindPort);
  server.setThreadCount(threadCount);
  if (crazyMode) {
    System.err.println("String_Node_Str");
    server.setIface(ThriftBlurShardServer.crazyMode(iface));
  }
 else {
    server.setIface(iface);
  }
  new BlurServerShutDown().register(new BlurShutdown(){
    @Override public void shutdown(){
      ThreadWatcher threadWatcher=ThreadWatcher.instance();
      quietClose(server,controllerServer,clusterStatus,zooKeeper,threadWatcher);
      System.exit(0);
    }
  }
,zooKeeper);
  server.start();
}

Fixed version (ground truth):
public static void main(String[] args) throws TTransportException, IOException, KeeperException, InterruptedException, BlurException {
  int serverIndex=getServerIndex(args);
  LOG.info("String_Node_Str");
  Thread.setDefaultUncaughtExceptionHandler(new SimpleUncaughtExceptionHandler());
  BlurConfiguration configuration=new BlurConfiguration();
  String bindAddress=configuration.get(BLUR_CONTROLLER_BIND_ADDRESS);
  int bindPort=configuration.getInt(BLUR_CONTROLLER_BIND_PORT,-1);
  bindPort+=serverIndex;
  LOG.info("String_Node_Str",serverIndex,bindAddress + "String_Node_Str" + bindPort);
  Configuration config=new Configuration();
  BlurMetrics blurMetrics=new BlurMetrics(config);
  String nodeName=ThriftBlurShardServer.getNodeName(configuration,BLUR_CONTROLLER_HOSTNAME);
  nodeName=nodeName + "String_Node_Str" + bindPort;
  String zkConnectionStr=isEmpty(configuration.get(BLUR_ZOOKEEPER_CONNECTION),BLUR_ZOOKEEPER_CONNECTION);
  BlurQueryChecker queryChecker=new BlurQueryChecker(configuration);
  final ZooKeeper zooKeeper=ZkUtils.newZooKeeper(zkConnectionStr);
  ZookeeperSystemTime.checkSystemTime(zooKeeper,configuration.getLong(BLUR_ZOOKEEPER_SYSTEM_TIME_TOLERANCE,3000));
  final ZookeeperClusterStatus clusterStatus=new ZookeeperClusterStatus(zooKeeper);
  BlurClient client=new BlurClientRemote();
  final BlurControllerServer controllerServer=new BlurControllerServer();
  controllerServer.setClient(client);
  controllerServer.setClusterStatus(clusterStatus);
  controllerServer.setZookeeper(zooKeeper);
  controllerServer.setNodeName(nodeName);
  controllerServer.setRemoteFetchCount(configuration.getInt(BLUR_CONTROLLER_REMOTE_FETCH_COUNT,100));
  controllerServer.setMaxQueryCacheElements(configuration.getInt(BLUR_CONTROLLER_CACHE_MAX_QUERYCACHE_ELEMENTS,128));
  controllerServer.setMaxTimeToLive(configuration.getLong(BLUR_CONTROLLER_CACHE_MAX_TIMETOLIVE,TimeUnit.MINUTES.toMillis(1)));
  controllerServer.setQueryChecker(queryChecker);
  controllerServer.setThreadCount(configuration.getInt(BLUR_CONTROLLER_SERVER_REMOTE_THREAD_COUNT,64));
  controllerServer.setMaxFetchRetries(configuration.getInt(BLUR_CONTROLLER_RETRY_MAX_FETCH_RETRIES,1));
  controllerServer.setMaxMutateRetries(configuration.getInt(BLUR_CONTROLLER_RETRY_MAX_MUTATE_RETRIES,1));
  controllerServer.setMaxDefaultRetries(configuration.getInt(BLUR_CONTROLLER_RETRY_MAX_DEFAULT_RETRIES,1));
  controllerServer.setFetchDelay(configuration.getInt(BLUR_CONTROLLER_RETRY_FETCH_DELAY,500));
  controllerServer.setMutateDelay(configuration.getInt(BLUR_CONTROLLER_RETRY_MUTATE_DELAY,500));
  controllerServer.setDefaultDelay(configuration.getInt(BLUR_CONTROLLER_RETRY_DEFAULT_DELAY,500));
  controllerServer.setMaxFetchDelay(configuration.getInt(BLUR_CONTROLLER_RETRY_MAX_FETCH_DELAY,2000));
  controllerServer.setMaxMutateDelay(configuration.getInt(BLUR_CONTROLLER_RETRY_MAX_MUTATE_DELAY,2000));
  controllerServer.setMaxDefaultDelay(configuration.getInt(BLUR_CONTROLLER_RETRY_MAX_DEFAULT_DELAY,2000));
  controllerServer.init();
  Iface iface=BlurUtil.recordMethodCallsAndAverageTimes(blurMetrics,controllerServer,Iface.class);
  int threadCount=configuration.getInt(BLUR_CONTROLLER_SERVER_THRIFT_THREAD_COUNT,32);
  final ThriftBlurControllerServer server=new ThriftBlurControllerServer();
  server.setNodeName(nodeName);
  server.setConfiguration(configuration);
  server.setBindAddress(bindAddress);
  server.setBindPort(bindPort);
  server.setThreadCount(threadCount);
  server.setIface(iface);
  new BlurServerShutDown().register(new BlurShutdown(){
    @Override public void shutdown(){
      ThreadWatcher threadWatcher=ThreadWatcher.instance();
      quietClose(server,controllerServer,clusterStatus,zooKeeper,threadWatcher);
      System.exit(0);
    }
  }
,zooKeeper);
  server.start();
}