Skip to content

Fix sdaf network peering issue #22709

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

Merged

Conversation

lilyeyes
Copy link
Contributor

@lilyeyes lilyeyes commented Jul 21, 2025

Add retry as well for sdaf network peering issue: ErrorCode:LeaseAlreadyPresent

Previous PR #22666 fixed when find network being used instead of checking other network from the list, it just created new file.

There is also a PR from Michele to fix his comments left here: #22741

  • Related ticket: TEAM-10465 - [SDAF] Fix network space assignment logic

  • Verification run (test results are as expected):

https://openqaworker15.qa.suse.cz/tests/333419#step/deploy_workload_zone/95 (using fake data to produce: searched for 1 times less than 10 times, found ErrorCode then continue to search next old network)
https://openqaworker15.qa.suse.cz/tests/333419#step/deploy_workload_zone/128 (then found next old network is usable at the second time, then use it)
2.
https://openqaworker15.qa.suse.cz/tests/333411#step/deploy_workload_zone/359 (searched for 11 times more than 10 times (all found ErrorCode ), then returnto create anew` network)
3.
https://openqaworker15.qa.suse.cz/tests/333420#step/deploy_workload_zone/92 (normal run is as expected)

@lilyeyes lilyeyes force-pushed the fix-sdaf-network-peering-issue2 branch 13 times, most recently from 79f4777 to a7e882d Compare July 21, 2025 10:19
@lilyeyes lilyeyes marked this pull request as ready for review July 21, 2025 10:41
Copy link
Contributor

@lpalovsky lpalovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lilyeyes lilyeyes force-pushed the fix-sdaf-network-peering-issue2 branch from a7e882d to d30d107 Compare July 22, 2025 06:53
TEAM-10465 - [SDAF] Fix network space assignment logic
@lilyeyes lilyeyes force-pushed the fix-sdaf-network-peering-issue2 branch from d30d107 to d51d8c4 Compare July 23, 2025 07:17
Copy link
Contributor

@mpagot mpagot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -311,6 +311,7 @@ sub assign_defined_network {
my @lease_files;
my $lease_file;
my $count = 0;
my $num = 10; # Exit the dead loop if exceed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about covering the new behavior in a unit test in 18_networking.t ?

@@ -223,7 +223,7 @@ sub acquire_network_file_lease {
my $lease_id = az_storage_blob_lease_acquire(%arguments);

# Return unless the file lease was successful
return unless $lease_id;
return if (!$lease_id || $lease_id =~ 'ErrorCode');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this change is not needed here. I think we should improve the handling of the return value within az_storage_blob_lease_acquire.

That function seems to need some adjustment. For example:

return -1 if ($lease_id =~ 'ErrorCode');
return ($lease_id) if az_validate_uuid_pattern(uuid => $lease_id);
return -1; or return undef;

All of the 3 should be covered by Unit tests

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking a little bit more about it: how is it possible az_validate_uuid_pattern is declaring a UUID to be valid if it contains ErrorCode. I think the code should be improved there.

I'm also thinking about az_validate_uuid_pattern return value. At the moment it return the input UUID string or 0. I think it could be changed to return 1 (valid UUID) or 0 (invalid UUID). Or something similar.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here some suggestions about how to proceed

@lilyeyes lilyeyes merged commit e0cc351 into os-autoinst:master Jul 23, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants