Fix NPE due to race condition during system vm launch.

This commit is contained in:
Min Chen 2013-11-04 14:26:42 -08:00
parent 5ccf3a90ab
commit eb9cfffd24
1 changed files with 1 additions and 0 deletions

View File

@ -453,6 +453,7 @@ public class VolumeServiceImpl implements VolumeService {
} catch (Throwable e) {
s_logger.debug("failed to create template on storage", e);
templateOnPrimaryStoreObj.processEvent(Event.OperationFailed);
dataStore.create(template); // make sure that template_spool_ref entry is still present so that the second thread can acquire the lock
VolumeApiResult result = new VolumeApiResult(volume);
result.setResult(e.toString());
future.complete(result);