code: protected void adjustSyncTimeout(int timeoutMs) {
      int timeoutSec = (timeoutMs + 999) / 1000;
      // Finds out the smallest timeout which is powers of 2 and larger than
      // timeoutMs.
      for (int i = 0; i < 32; ++i) {
        if ((1 << i) >= timeoutSec) {
          LOG.debug("Adjust timeout to {} sec", 1 << i);
          setSyncTimeoutMs((1 << i) * 1000);
          return;
        }
      }
      throw new RuntimeException("Timeout is too large!");
    }
docs: Adjusts the synchronizing timeout based on parameter timeoutMs. The new
  synchronizing timeout will be smallest timeout which is power of 2 and
  larger than timeoutMs.
  
  @param timeoutMs the last synchronizing timeout in milliseconds.