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

jvergara
21.29.2008 ed58db6ca2f1bf1cff45600f960996a370d70d02
Fix for issue 2862 (Online backup command exit status 0 while backup is failed).

The code used to consider the errors during backup as warnings. In general the errors during the backupmean that at least one backend could not be backed up, the modifications simply update the code to return TaskState.STOPPED_BY_ERROR instead of TaskState.COMPLETED_WITH_ERRORS. This is more accurate because if one of the backends is not backed up we should return an error code and because every error detected in the backup code stops the backup processing of a particular backend.
1 files modified
7 ■■■■■ changed files
opendj-sdk/opends/src/server/org/opends/server/tasks/BackupTask.java 7 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tasks/BackupTask.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Portions Copyright 2006-2007 Sun Microsystems, Inc.
 *      Portions Copyright 2006-2008 Sun Microsystems, Inc.
 */
package org.opends.server.tasks;
import org.opends.messages.Message;
@@ -664,12 +664,13 @@
    // Print a final completed message, indicating whether there were any errors
    // in the process.
    // in the process.  In this case it means that the backup could not be
    // completed at least for one of the backends.
    if (errorsEncountered)
    {
      Message message = NOTE_BACKUPDB_COMPLETED_WITH_ERRORS.get();
      logError(message);
      return TaskState.COMPLETED_WITH_ERRORS;
      return TaskState.STOPPED_BY_ERROR;
    }
    else if (isCancelled())
    {