-
Notifications
You must be signed in to change notification settings - Fork 74
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
RPC execution stuck when NETCONF server closes session unexpectedly #914
Comments
Reproduced the issue with this test script:
To reproduce the issue
Observe the python process is hanging until manually killed. Expected behavior |
Root cause
Because of unexpected process interruption, the control is not returned to Python process, which then gets in limbo. |
After the fixes applied the exception caught as expected and script finished normally.
|
I found that the C++ API works fine in all environments when connection to Netconf is broken. The Python API is also working as expected in all the tests with confd, But all the Python tests fail showing the same symptoms when connection is set to ASR9K sandbox. Therefore reopening the bug. |
Resolved the issue by altering libnetconf code (session.c) to prevent endless loops. As a result the Python API started to work and develops YClientError exception as expected. Here is end of the log for original script:
|
Expected Behavior
RPC invocation must exit with an error if the underlying NETCONF session is closed by the server.
Current Behavior
NETCONF session has been established using the NetconfServiceProvider, then an RPC is invoked which gets stuck when NETCONF server is killed or crashed.
The python script never exits, neither does it dump any error messages. The last log message seen is "============= Sending RPC to device ============="
Steps to Reproduce
In the test environment, NCA app container connects to NSO to modify a device config, which is managed by this NSO.
The NSO server is running on 192.168.123.11 port 2022
Steps to get into the test setup:
kubectl exec -it $(kubectl get pods|grep robot-nca|grep Running|cut -d' ' -f1) bash
Your Script
test_session_close.py.txt
Logs
test_session_close.log
System Information
Linux robot-nca-74f49fcd9-487rz 4.15.0-47-generic #50-Ubuntu SMP Wed Mar 13 10:44:52 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Python 2.7.15rc1
ydk==0.7.2.post1
ydk-models-cisco-ios-xr==6.3.2
ydk-models-ietf==0.1.5
ydk-models-ned-ios==5.9.2
ydk-models-ned-ios-xr==6.6.1
ydk-models-openconfig==0.1.2
ydk-models-tailf==6.4.1
Reported by
Nitish Vashishtha (nvashish@cisco.com)
SPNAC / Crosswork / NCA
The text was updated successfully, but these errors were encountered: