-
Notifications
You must be signed in to change notification settings - Fork 9
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
Added retry mechanism and nmcli commands to set IP for host-acc comm channel. #237
Conversation
484ec26
to
0feeadd
Compare
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.
Line 209: Must ipAddrSet be initialized to false?
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.
Line 266: You could return here too, instead of break?
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.
Generally, break is considered better...than return from inside a for-loop. So if you are fine, would keep this part as-it-is.
Not required, just a good programming practice. |
0feeadd
to
83bb9ea
Compare
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.
nmcli sequence changes looks good.
83bb9ea
to
b322a74
Compare
…or each interface, to stabilize and become activated. With Option2: we try to use nmcli to set IP addrtess. But during host reboot, network manager daemon is flaky, wherein even if interface(conn) does not exist in nmcli's DB, it thinks it exists, and causes issues. This function does a few retries, when it tries to set IP.
b322a74
to
5e5de66
Compare
if err != nil { | ||
log.Errorf("ip link set err->%v, output->%v\n", err, output) | ||
return fmt.Errorf("ip link set err->%v, output->%v\n", err, output) | ||
runCmd = fmt.Sprintf(`nmcli conn show | grep -w "%s"`, intfName) |
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.
nmcli conn show should also specify intfName...otherwise...we end up making invalid assumption...that interface already exists....when actually....that interface name just happens...to show up in a different coloumn...as part of the output.
Plan to keep this branch...for a while..just for reference...in case...we want to re-surrect this for some reason. Although it will aslo need this additional change-> nmcli conn show should also specify intfName...otherwise...we end up making invalid assumption...that interface already exists....when actually....that interface name just happens...to show up in a different coloumn...as part of the output. |
Upon host reboot, it seems to take time for network-manager's state for each interface,
to stabilize and become activated. This function does a few retries,
when it tries to set IP.