Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Async IO task is getting stuck at send_command method. #58

Open
mani3887 opened this issue Jul 2, 2021 · 0 comments
Open

Async IO task is getting stuck at send_command method. #58

mani3887 opened this issue Jul 2, 2021 · 0 comments

Comments

@mani3887
Copy link

mani3887 commented Jul 2, 2021

Describe the bug
Hi,

We are observing a condition where the asyncio task getting stuck at send_command method in Netdev library. This condition happens for the device models:

  1. Cisco Nexus 3048PT(Cisco NXOS)
  2. Cisco ASR 9001( Cisco IOS-XR)

When we enabled the netdev logs, we saw that the library hangs in:

2021-06-22T20:28:40.233974439Z Host : Stripping prompt
2021-06-22T20:28:40.234000040Z Stripping command
2021-06-22T20:28:40.235203004Z Host Disconnecting
2021-06-22T20:28:40.235248606Z Host Cleanup session
2021-06-22T20:28:40.235309610Z Host Exiting from configuration mode
2021-06-22T20:28:40.235333911Z Host Checking configuration mode
2021-06-22T20:28:40.235739232Z Host Reading until pattern

A clear and concise description of what the bug is.
We observe that when the condition happens, the code hangs and the control is not coming to the main method. While following the library code, on where the code hangs, the netdev library code hangs in: _read_until_pattern method, inside the while True block, more specifically on the re.search line(if re.search(pattern, output, flags=re_flags): in vendors/base.py:362. Since it is happening only for few models, we suspect the re.search method hangs because of catastrophic backtracking while searching on the base_pattern. If possible, can you please add a functionality to raise an exception if this condition occurs?

Thanks for your help in advance.

Regards,
Mani

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant