Skip to content

Commit fd02d47

Browse files
committed
<fix>[multi]: fix review findings: dryRun completion, initializeHostAttachedPSMountPath NPE
Resolves: ZSTAC-69300 Change-Id: I1b39a9e7b76751e8a4ef4cc53e9ac2028386e334
1 parent 96db963 commit fd02d47

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

compute/src/main/java/org/zstack/compute/allocator/HostAllocatorChain.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,11 @@ private void runFlow(AbstractHostAllocatorFlow flow) {
147147
} catch (Throwable t) {
148148
logger.warn("unhandled throwable", t);
149149
String errMsg = t != null ? t.toString() : "unknown error";
150-
if (completion != null) {
150+
if (isDryRun) {
151+
if (dryRunCompletion != null) {
152+
dryRunCompletion.fail(inerr(ORG_ZSTACK_COMPUTE_ALLOCATOR_10019, errMsg));
153+
}
154+
} else if (completion != null) {
151155
completion.fail(inerr(ORG_ZSTACK_COMPUTE_ALLOCATOR_10019, errMsg));
152156
}
153157
}

plugin/localstorage/src/main/java/org/zstack/storage/primary/local/LocalStorageKvmBackend.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3819,7 +3819,8 @@ public void success(AgentResponse rsp) {
38193819

38203820
@Override
38213821
public void fail(ErrorCode errorCode) {
3822-
completion.fail(operr(ORG_ZSTACK_STORAGE_PRIMARY_LOCAL_10082, "cannot create flag file [%s] on host [%s], because: %s", makeInitializedFilePath(), hostUuid, errorCode.getCause().getDetails()));
3822+
String causeDetails = errorCode.getCause() != null ? errorCode.getCause().getDetails() : errorCode.getDetails();
3823+
completion.fail(operr(ORG_ZSTACK_STORAGE_PRIMARY_LOCAL_10082, "cannot create flag file [%s] on host [%s], because: %s", makeInitializedFilePath(), hostUuid, causeDetails));
38233824
}
38243825
});
38253826
}

0 commit comments

Comments
 (0)