New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't fail when connection list is empty #77
Conversation
/ost |
/ost |
Verified manually, engine:
vdsm:
|
/ost |
The warning is good - but disconnectStorageServer should return now. We should not refresh storage or do any other change bellow:
I think the needed change is something like:
Input must be validated when it enters the system. We should not pass untrusted |
/ost |
engine:
vdsm:
OST: https://redir.apps.ovirt.org/dj/job/ds-ost-baremetal_manual/28586 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Second patch looks good, but it seems that we are missing xfail mark
in the first.
When connecting or disconnecting storage server, current code assumes that connection list sent by engine is never empty. However, this is not the case and when there are two or more iSCSI SDs which use same iSCSI target, engine sends empty connection list when requesting disconnect, see BZ #2054745 [1] for more details. In such case current code fails with UnboundLocalError: local variable 'con_info' referenced before assignment which is bad in any case. Avoid using potentially undefied variable. Better handling of empty connection list will be improved in follow-up patch. [1] https://bugzilla.redhat.com/2054745 Change-Id: I1a4a5d068ff75669d3ceafee1cc427213a552538 Signed-off-by: Vojtech Juranek <vjuranek@redhat.com>
When multiple iSCSI SDs use same iSCSI target and one of these SDs is put into maintenance, engine sends vdsm disconnect storage server request with empty connection list. While it's questionable why engine sends such request, vdsm still has handle it and has to do nothing as the target is still used by other SDs. Do nothing in this case, but log a warning, because this should be fixed in the engine and engine shouldn't request disconnecting storage server when it's used by other SDs. As calling code expect iterable with results, return empty list. Change-Id: I7de2b77dbda788883600c14893bc2d1485f59804 Bug-Url: https://bugzilla.redhat.com/2054745 Signed-off-by: Vojtech Juranek <vjuranek@redhat.com>
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Don't fail when engine sends empty connection list on storage server disconnect. This happens when multiple iSCSI SDs use same iSCSI target and therefore it cannot be disconnected as it's still used by other SDs. Engine should be fixed not to send disconnect request in such case, but we need to handle older engines. Log warning in such case, do nothing and return empty list as calling code expects iterable with results..
On the other hand engine always sends non-empty connection list when connecting SD. If the list is empty for some reason when connecting storage server, also log warning, but let vdsm throw
KeyError
as this is unexpected.Fixes https://bugzilla.redhat.com/2054745