mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

abobrov
17.38.2009 38bdf817e5e1f5583b397f0392238609c2ad02d1
- reject tasks with missing dependencies.
2 files modified
15 ■■■■ changed files
opendj-sdk/opends/src/messages/messages/backend.properties 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/task/TaskScheduler.java 11 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/messages/messages/backend.properties
@@ -1140,5 +1140,5 @@
specify the number of cleaner threads: defaulting to %d threads
INFO_ERGONOMIC_SIZING_OF_JE_LOCK_TABLES_411=Local DB backend %s does not \
specify the number of lock tables: defaulting to %d
SEVERE_ERR_TASKSCHED_DEPENDENCY_MISSING_412=Unable to schedule task %s \
because its dependency task %s is missing
opendj-sdk/opends/src/server/org/opends/server/backends/task/TaskScheduler.java
@@ -349,6 +349,17 @@
        throw new DirectoryException(ResultCode.ENTRY_ALREADY_EXISTS, message);
      }
      for (String dependencyID : task.getDependencyIDs())
      {
        Task t = tasks.get(dependencyID);
        if (t == null)
        {
          Message message = ERR_TASKSCHED_DEPENDENCY_MISSING.get(
            String.valueOf(id), dependencyID);
          throw new DirectoryException(ResultCode.NO_SUCH_OBJECT, message);
        }
      }
      tasks.put(id, task);
      TaskState state = shouldStart(task);