cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [cloudstack] onitake commented on issue #3546: [FIX] Rethrow takeVMSnapshot() exception
Date Wed, 07 Aug 2019 16:24:03 GMT
onitake commented on issue #3546: [FIX] Rethrow takeVMSnapshot() exception
URL: https://github.com/apache/cloudstack/pull/3546#issuecomment-519170384
 
 
   `VMSnapshotManagerImpl.orchestrateCreateVMSnapshot(Long vmId, Long vmSnapshotId, Boolean
quiescevm)` is used in two places:
   - `VMSnapshotManagerImpl.orchestrateCreateVMSnapshot(VmWorkCreateVMSnapshot work)` where
the null value will lead to the NPE and stray DB entry
   - `VMSnapshotManagerImpl.createVMSnapshot(Long vmId, Long vmSnapshotId, Boolean quiescevm)`
where it is returned directly
   
   `createVMSnapshot` in turn is used in two places:
   - `CreateVMSnapshotCmd.execute()`, where the null value is checked and a different exception
is thrown (`ServerApiException`)
   - `StorageSystemSnapshotStrategy.takeHypervisorSnapshot(VolumeInfo volumeInfo)` where the
null value is also checked and a `CloudRuntimeException` is thrown.
   
   An alternative fix for the NPE would be to modify `VMSnapshotManagerImpl.orchestrateCreateVMSnapshot(VmWorkCreateVMSnapshot
work) in the snapshot.getId()` to check for a null value before calling `getId()`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message