Repository navigation
Conversation
|
@blueorangutan package |
|
@Pearl1594 a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos7 ✔centos8 ✔debian. JID-2885 |
| sourceVolumeTemplateStoragePoolVO = vmTemplatePoolDao.findByPoolTemplate(destStoragePool.getId(), srcVolumeInfo.getTemplateId(), null); | ||
| } | ||
| if (sourceVolumeTemplateStoragePoolVO == null && destStoragePool.getPoolType() == StoragePoolType.Filesystem) { | ||
| DataStore sourceTemplateDataStore = dataStoreManagerImpl.getRandomImageStore(srcVolumeInfo.getDataCenterId()); |
There was a problem hiding this comment.
@Pearl1594 can you help me understanding on which object we are getting NPE. I'm seeing only srcVolumeInfo as possible object but it would have failed earlier at 198 Line.
There was a problem hiding this comment.
@harikrishna-patnala I've updated the exception, you're right, the exception happens at line198 - I had added a few debug lines which was why it showed the exception occuring at L200
There was a problem hiding this comment.
@harikrishna-patnala The problem is that findByPoolTemplate receives a long (primitive type) to template and getTemplateId returns a Long (object type). Java will do an autounboxing, but as getTemplateId returns null for non-template volume (data disks), it will generate a NPE when trying to autounbox this value.
There was a problem hiding this comment.
@GutoVeronezi wouldn't srcVolumeInfo.getTemplateId() != null prevents what you mentioned?
There was a problem hiding this comment.
@GabrielBrascher It will. I mention it to explain why it is happening.
|
I would ask you to take a look at the PR #4698. As it was proposed before this PR, I think it would be interesting to consider it first for this problem. |
|
@GutoVeronezi I see that code is changed in different places than the code in this PR. Are you saying that PR makes this obsolete or do they merit merging each in their own right? |
|
Thanks for opening this PR @Pearl1594. This PR seems to address the same issue as PR #4698 but in a different way. I think that it is important to evaluate which one suits better before moving on with this or the other PR. It is important to raise also that it seems that @GutoVeronezi will only work to the master, so we can have also a PR specifically for 4.15, or cherry-pick hist commit (if we decide that his option is the better). |
|
@DaanHoogland @GutoVeronezi you were quicker than me, I pressed enter to send the message and then your comments appear. Taking a deeper look, I think that both handle different situations. Very similar, but still complementary situations. |
@GabrielBrascher The problem is that findByPoolTemplate receives a long (primitive type) to template and getTemplateId returns a Long (object type). Java will do an autounboxing, but as getTemplateId returns null for non-template volume (data disks), it will generate a NPE when trying to autounbox this value. |
@DaanHoogland Both PRs address the same problem, which is to handle the template id in case it is null (for data disks); the main difference is that, that this PR made validations out of the scope of the method, where it seems more interesting, as it verifies if we are handling a volume created from a template before calling the copy template method. Further, we added some logging to facilitate the life of operators if they ever need to troubleshoot this process. |
|
@GutoVeronezi I know how That is why I already mentioned about |
|
Anyway, I see one check that this PR does and #4698 does not. Which is checking if However looking at the code, I don't see any way that it can be null. If With that said, I am +1 on @GutoVeronezi solution; he adds quite interesting log messages. |
|
Thanks @GutoVeronezi and @GabrielBrascher. I hadn't noticed that the issue was already addressed. And as mentioned it does add useful logs. Ill close this PR. Thanks! |
|
Reviewed @GutoVeronezi and prefer that one as well |
|
Trillian test result (tid-3673)
|
Description
This PR fixes the failure noticed during live migration of an instance with a data volume not based off a template. The issue is noticed on centos 8 which causes the TestKVMLiveMigration::test_test_02_migrate_VM_with_two_data_disks to fail
Corresponding exception observed on MS:
Types of changes
Feature/Enhancement Scale or Bug Severity
Bug Severity
How Has This Been Tested?
Run the test for live-migrating a VM with its volumes comprising of root volume + 2 data disks