hostcfgd: Add one shot timer to reload tacacs config from CONFIG-DB #9987
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why I did it
There is a small window between load & listen to config-DB. If TACACS config got updated during that gap, the listen will not show it, hence hostcfgd would miss it, until another update.
How I did it
porting PR #8223, which uses one shot timer to reload tacacs config.
How to verify it
Copy this binary to a 201811 device and
Run config reload & restart of hostcfd concurrently, multiple times to see, if hostcfgd miss the update or not.
Ran a repeated config reload for testing.
It did succeed.
But it could not really hit the repro, which is kind of expected as it is is very hard to hit the repro in 201811
[Tweaked code with a log message, that dumps the read value with isTimer to indicate normal load vs via timer]
Which release branch to backport (provide reason below if selected)
This is the backport to 201811
Description for the changelog
Add a one shot timer after load; Reload tacacs config from DB, upon the timer.
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)