Skip to content

Commit

Permalink
chore: update logging for bootstrap on rollback (#1557)
Browse files Browse the repository at this point in the history
  • Loading branch information
alter-mage committed Nov 3, 2023
1 parent 8077a67 commit a7c4fa2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ public boolean isBootstrapRequired(Map<String, Object> newConfig, Set<String> co
}
});
if (componentsRequiresBootstrapTask.isEmpty()) {
logger.atInfo().log("No component found with a pending bootstrap task");
// Force restart if
// 1. any nucleus config change requires restart or
// 2. if any plugin will be removed in the deployment to ensure plugin cleanup
Expand Down Expand Up @@ -369,6 +370,9 @@ private boolean nucleusConfigValidAndNeedsRestart(Map<String, Object> deployment
}
}

if (needsRestart) {
logger.atInfo().log("Bootstrap required as some component configs changed");
}
return needsRestart;
}

Expand Down Expand Up @@ -478,8 +482,9 @@ public void deleteBootstrapTaskList(Path persistedTaskFilePath) throws IOExcepti
logger.atError().log("No bootstrap task list to delete: the provided file path was null");
return;
}
logger.atInfo().kv("filePath", persistedTaskFilePath).log("Deleting bootstrap task list");
Files.deleteIfExists(persistedTaskFilePath);
if (Files.deleteIfExists(persistedTaskFilePath)) {
logger.atInfo().kv("filePath", persistedTaskFilePath).log("Deleted bootstrap task list");
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,8 @@ public boolean prepareBootstrapOnRollbackIfNeeded(Context context,
return false;
}
} else {
logger.atInfo().log("No component with a pending rollback bootstrap task found: "
+ "No rollback deployment exists or rollback deployment has no bootstrap tasks");
// Bootstrap-on-rollback is not required, so ensure that the task file is deleted.
try {
bootstrapManager.deleteBootstrapTaskList(rollbackBootstrapTaskFilePath);
Expand Down

0 comments on commit a7c4fa2

Please sign in to comment.