docs: public void syncFromStorage()
    {
      giant.lock();
  
      try {
        // Load stuff from taskStorage first. If this fails, we don't want to lose all our locks.
        final Set<String> storedActiveTasks = new HashSet<>();
        final List<Pair<Task, TaskLock>> storedLocks = new ArrayList<>();
        for (final Task task : taskStorage.getActiveTasks()) {
          storedActiveTasks.add(task.getId());
          for (final TaskLock taskLock : taskStorage.getLocks(task.getId())) {
            storedLocks.add(Pair.of(task, taskLock));
          }
        }
        // Sort locks by version, so we add them back in the order they were acquired.
        final Ordering<Pair<Task, TaskLock>> byVersionOrdering = new Ordering<Pair<Task, TaskLock>>()
        {
          @Override
          public int compare(Pair<Task, TaskLock> left, Pair<Task, TaskLock> right)
          {
            // The second compare shouldn't be necessary, but, whatever.
            return ComparisonChain.start()
                                  .compare(left.rhs.getVersion(), right.rhs.getVersion())
                                  .compare(left.lhs.getId(), right.lhs.getId())
                                  .result();
          }
        };
        running.clear();
        activeTasks.clear();
        activeTasks.addAll(storedActiveTasks);
        // Bookkeeping for a log message at the end
        int taskLockCount = 0;
        for (final Pair<Task, TaskLock> taskAndLock : byVersionOrdering.sortedCopy(storedLocks)) {
          final Task task = taskAndLock.lhs;
          final TaskLock savedTaskLock = taskAndLock.rhs;
          if (savedTaskLock.getInterval().toDurationMillis() <= 0) {
            // "Impossible", but you never know what crazy stuff can be restored from storage.
            log.warn("WTF?! Got lock[%s] with empty interval for task: %s", savedTaskLock, task.getId());
            continue;
          }
  
          // Create a new taskLock if it doesn't have a proper priority,
          // so that every taskLock in memory has the priority.
          final TaskLock savedTaskLockWithPriority = savedTaskLock.getPriority() == null
                                        ? TaskLock.withPriority(savedTaskLock, task.getPriority())
                                        : savedTaskLock;
  
          final TaskLockPosse taskLockPosse = createOrFindLockPosse(task, savedTaskLockWithPriority);
          if (taskLockPosse != null) {
            taskLockPosse.addTask(task);
  
            final TaskLock taskLock = taskLockPosse.getTaskLock();
  
            if (savedTaskLockWithPriority.getVersion().equals(taskLock.getVersion())) {
              taskLockCount++;
              log.info(
                  "Reacquired lock[%s] for task: %s",
                  taskLock,
                  task.getId()
              );
            } else {
              taskLockCount++;
              log.info(
                  "Could not reacquire lock on interval[%s] version[%s] (got version[%s] instead) for task: %s",
                  savedTaskLockWithPriority.getInterval(),
                  savedTaskLockWithPriority.getVersion(),
                  taskLock.getVersion(),
                  task.getId()
              );
            }
          } else {
            throw new ISE(
                "Could not reacquire lock on interval[%s] version[%s] for task: %s",
                savedTaskLockWithPriority.getInterval(),
                savedTaskLockWithPriority.getVersion(),
                task.getId()
            );
          }
        }
        log.info(
            "Synced %,d locks for %,d activeTasks from storage (%,d locks ignored).",
            taskLockCount,
            activeTasks.size(),
            storedLocks.size() - taskLockCount
        );
      }
      finally {
        giant.unlock();
      }
    }