Fix sonic-utilities submodule update failure due to ijson library#4256
Fix sonic-utilities submodule update failure due to ijson library#4256saiarcot895 merged 10 commits intosonic-net:masterfrom
Conversation
This diff modifies the route_check.py to not invoke "show" and rather invoke the vtysh cmd directly. It then attempt to interpret one route at a time in a paginated manner. This prevents a sudden transient memory buildup. The zebra process already does the right thing and backs off when the output socket buffers are full. There is probably scope to improve that further (Refer to https://sonicfoundation.dev/2025-sonic-hackathon-most-impactful-award-spotlight-optimizing-output-buffer-memory-for-show-commands/) Signed-off-by: Venkit Kasiviswanathan <[email protected]>
Signed-off-by: Venkit Kasiviswanathan <[email protected]>
Signed-off-by: Venkit Kasiviswanathan <[email protected]>
Signed-off-by: Venkit Kasiviswanathan <[email protected]>
Signed-off-by: Venkit Kasiviswanathan <[email protected]>
Signed-off-by: Venkit Kasiviswanathan <[email protected]>
There was a failure when sonic-mgmt tests were run in a KVM. The failure appears to be due to the environment where it is running. It seems like on this environment ijson is not able to find the C-libraries required to set a default backend. Force a python backend to iterm. Signed-off-by: Venkit Kasiviswanathan <[email protected]>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Venkit Kasiviswanathan <[email protected]>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@saiarcot895 @deepak-singhal0408 @prsunny I made a fix recommended by @saiarcot895. But code coverage is failing due to lack of coverage in the following lines: try: I am not sure if it is worth adding coverage for this. I am not sure how to add coverage for imports. Alternatively, I can simply add the python backend. |
The alternative C backend has an issue that is best described by a comment from saiarcot895 in sonic-net#4205 Signed-off-by: Venkit Kasiviswanathan <[email protected]>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@saiarcot895 @deepak-singhal0408 |
|
@venkit-nexthop Looks like this method doesn't actually work: The I'm thinking setting the |
I had an earlier version of this PR where I was not using ijson and instead had my own parsing logic. |
Hi @venkit-nexthop, @saiarcot895 this is the official recommendation from ijson documenation as well.. https://github.com/ICRAR/ijson#backends |
|
Sounds good @deepak-singhal0408 I will try setting env variable before importing in the route_check script. |
…nic-net#4256) * Fix route_check.py to not hog a lot of memory This diff modifies the route_check.py to not invoke "show" and rather invoke the vtysh cmd directly. It then attempt to interpret one route at a time in a paginated manner. This prevents a sudden transient memory buildup. The zebra process already does the right thing and backs off when the output socket buffers are full. There is probably scope to improve that further (Refer to https://sonicfoundation.dev/2025-sonic-hackathon-most-impactful-award-spotlight-optimizing-output-buffer-memory-for-show-commands/) Signed-off-by: Venkit Kasiviswanathan <[email protected]> * Fix merge conflicts related test failure from upstream Signed-off-by: Venkit Kasiviswanathan <[email protected]> * Fix precommit check failure Signed-off-by: Venkit Kasiviswanathan <[email protected]> * Revert back to using the TIMEOUT from the earlier code. Signed-off-by: Venkit Kasiviswanathan <[email protected]> * Fixed review comments from upstream Signed-off-by: Venkit Kasiviswanathan <[email protected]> * Removed CHUNK_SIZE as it is not used any more Signed-off-by: Venkit Kasiviswanathan <[email protected]> * Fix failure with ijson library There was a failure when sonic-mgmt tests were run in a KVM. The failure appears to be due to the environment where it is running. It seems like on this environment ijson is not able to find the C-libraries required to set a default backend. Force a python backend to iterm. Signed-off-by: Venkit Kasiviswanathan <[email protected]> * Incorporate feedback from Sai Signed-off-by: Venkit Kasiviswanathan <[email protected]> * Pick the python backend for ijson The alternative C backend has an issue that is best described by a comment from saiarcot895 in sonic-net#4205 Signed-off-by: Venkit Kasiviswanathan <[email protected]> --------- Signed-off-by: Venkit Kasiviswanathan <[email protected]>
What I did
Forced the use of python backend for the ijson library
How I did it
How to verify it
Run the CI process of running sonic-mgmt test in a KVM environment.
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)