-
Notifications
You must be signed in to change notification settings - Fork 659
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
Add CLI configuration options for teamd retry count feature #2642
Changes from 19 commits
42b20c1
b42b635
e9e9af0
f834b8a
bd40c1b
7fc5ebd
b5b372b
c3c6b2e
ad54c4c
fc9195f
44a6712
5aa89b5
1a4e17f
bbad1e3
5acd304
0f4f822
e6acfe0
9e2d7a3
65c1bdb
edea4ce
f76e1e9
e547f50
a5966f2
1670cb7
ee72908
c719f32
01852c6
18fba7c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -663,6 +663,17 @@ if [[ "$REBOOT_TYPE" = "fast-reboot" ]]; then | |
fi | ||
fi | ||
|
||
TEAMD_INCREASE_RETRY_COUNT=0 | ||
if [[ "${REBOOT_TYPE}" = "warm-reboot" || "${REBOOT_TYPE}" = "fastfast-reboot" ]]; then | ||
/usr/local/bin/teamd_increase_retry_count.py --probe-only || TEAMD_RETRY_COUNT_PROBE_RC=$? | ||
if [[ TEAMD_RETRY_COUNT_PROBE_RC -ne 0 ]]; then | ||
debug "Warning: Retry count feature support unknown for one or more neighbor devices; assuming that it's not available" | ||
TEAMD_INCREASE_RETRY_COUNT=0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we supposed to bail out from here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the images we deploy to our internal environment, this will be changed to bail out and fail the warm-reboot if SONiC neighbors are not seen. For the public version, since we can't require using SONiC-only neighbors for warm reboot, this will only be a warning. |
||
else | ||
TEAMD_INCREASE_RETRY_COUNT=1 | ||
fi | ||
fi | ||
|
||
# We are fully committed to reboot from this point on because critical | ||
# service will go down and we cannot recover from it. | ||
set +e | ||
|
@@ -687,6 +698,10 @@ if [ -x ${LOG_SSD_HEALTH} ]; then | |
${LOG_SSD_HEALTH} | ||
fi | ||
|
||
if [[ ( "${REBOOT_TYPE}" = "warm-reboot" || "${REBOOT_TYPE}" = "fastfast-reboot" ) && "${TEAMD_INCREASE_RETRY_COUNT}" -eq 1 ]]; then | ||
/usr/local/bin/teamd_increase_retry_count.py | ||
fi | ||
|
||
# Stop any timers to prevent any containers starting in the middle of the process. | ||
TIMERS=$(systemctl list-dependencies --plain sonic-delayed.target | sed 1d) | ||
for timer in ${TIMERS}; do | ||
|
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.
Are you missing a
$
in variable usage? I think it should beif [[ $TEAMD_RETRY_COUNT_PROBE_RC -ne 0 ]]; then
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.
That was my initial thinking as well, but then I saw the use of this syntax in other parts of this file (above and below this section), and it worked, so I followed that syntax to match that style. I don't entirely know why it works (is there some feature in bash that checks to see that the string is a variable if it's not a number?), but I think it is better to have it with the
$
.I'll change it after verifying it doesn't break anything.
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.
I think you also need to set it to 0 before line 668? I agree it is better with $.
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.
Changed.
Strictly speaking, it didn't appear to be required (it worked correctly even though
$TEAMD_RETRY_COUNT_PROBE_RC
wasn't set), but I set it to 0 anyways.