Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Reset network_cli command_timeout (alarm) on data recv'd #35817
network_cli currently depends on the command_timeout variable to set the length of time that it waits for a command to FULLY complete. But it does not take into account if the device is actually sending output still.
Why not instead reset this timer when data is received?
This PR proposes that the
FYI, with this change, I was able to set
Extending COMMAND_TIMEOUT is a oft recommended fix to these timeout issues, but setting it to some large value is impractical because it results in any non-responsive device taking that much extra time to abort the command.
Yes, a very simple play using ios_config triggers this in part because it calls
With some additional (local) debugging turned on, you can see that the show running all is taking a good amount of time and ansible cuts the connection 10 seconds in a partial receipt of the response:
@privateip previously this may have been the case. But now with the great work from @ganeshrn and in particular the merged fix in #35439 network_cli no longer sends any commands to try to wake up the prompt (it just uses the last seen).
So in this PR, even in cases where the prompt is not found, the timeout will still occur because the device stops sending any output. I hope that you will see from the tests below that I have addressed your concerns. Network delays, device performance, etc can all affect how fast the device can return all the data we are asking of it. Using a timeout that is reset whenever the device outputs data is better than abruptly disconnecting a working, but slow connection short.
To prove out this theory, I have tested this in my branch in two ways.
Which also results in the expected timeout: