[sonic-cfggen] remove lazy_re workaround due to many optimizations done#47
Closed
stepanblyschak wants to merge 1 commit intomasterfrom
Closed
[sonic-cfggen] remove lazy_re workaround due to many optimizations done#47stepanblyschak wants to merge 1 commit intomasterfrom
stepanblyschak wants to merge 1 commit intomasterfrom
Conversation
lazy_re had an issue when importing sonic-cfggen in another application that
uses re.search():
```
Traceback (most recent call last):
File "/usr/local/bin/spm", line 8, in <module>
sys.exit(cli())
File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.7/dist-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/sonic_package_manager/main.py", line 202, in list
click.echo(tabulate.tabulate(table_body, table_header))
File "/usr/local/lib/python3.7/dist-packages/tabulate.py", line 1259, in tabulate
has_invisible = re.search(_invisible_codes, plain_text)
File "/usr/lib/python3.7/re.py", line 183, in search
return _compile(pattern, flags).search(string)
File "/usr/lib/python3.7/re.py", line 285, in _compile
raise TypeError("first argument must be string or compiled pattern")
TypeError: first argument must be string or compiled pattern
```
There is no much imporvement of lazy_re today after many other good optimization work
done for sonic-cfggen. It served as a quick temporary solution.
Some quick test for fast-reboot and warm-reboot done on top of 201911 branch:
Fast-reboot: from ASIC reset to ports in up state:
with lazy_re: 18 sec
without lazy_re: 18 sec
Warm-reboot: LAG restoration time:
with lazy_re: 73 sec
without lazy_re: 72 sec
So, there is no real optimization since the number of sonic-cfggen is grately reduced
in latest SONiC. This means it is time to revert this change.
Signed-off-by: Stepan Blyschak <[email protected]>
shlomibitton
approved these changes
Jul 20, 2021
stepanblyschak
pushed a commit
that referenced
this pull request
Apr 3, 2022
…onic-net#10406) #### Why I did it To take the following into sonic-buildimage 36e1f61 API endpoints to ConfigDBConnector to support pre-loading data without blackout (sonic-net#587) [sonic-swss-common](https://github.com/Azure/sonic-swss-common) ``` 36e1f61 API endpoints to ConfigDBConnector to support pre-loading data without blackout (sonic-net#587) 556f4ad Add SAI copy action to ACL schema (sonic-net#591) db18c3a Fix bitwidth of mac address in SAI ACL schema (sonic-net#590) e9442bb [ConfigDBPipeConnector]: Added set_entry API (sonic-net#586) 6c007c0 Update README for gmock (sonic-net#562) ``` [sonic-linkmgrd](https://github.com/Azure/sonic-linkmgrd) ``` 83dfc99 Enforce uniform file/class naming convention (#52) 83004bf Shutdown ICMP heartbeats when default route state is missing and ToR is in `auto` mode (#44) b81ea31 Add `LinkProberStateMachineActiveActive` (#47) c43cf7a Decrease link probing interval after switchover to better determine the overhead of a toggle (#43) 2239fbe Enhance clang format (#46) ``` #### How I did it * Advanced submodules pointers #### How to verify it 1. make configure PLATFORM=mellanox 2. make target/sonic-mellanox.bin
stepanblyschak
pushed a commit
that referenced
this pull request
Feb 24, 2025
…ly (sonic-net#21743) #### Why I did it src/sonic-stp ``` * 29eb387 - (HEAD -> master, origin/master, origin/HEAD) Fixing compilaion error for marvell_armhf (#47) (9 hours ago) [Divya Kumaran Chandralekha] * b7da558 - Merge pull request #44 from wajahatrazi/stp_co_pr (3 days ago) [Divya Kumaran Chandralekha] |\ | failure_prs.log skip_prs.log 47e1e77 - Merge branch 'master' into stp_co_pr (3 days ago) [Divya Kumaran Chandralekha] | |\ | |/ |/| * | 6e4a94f - Merge pull request #46 from divyachandralekha/pvst_pr_1 (4 days ago) [Divya Kumaran Chandralekha] |\ \ | failure_prs.log skip_prs.log | aa5e824 - libevent explicit building dependency removed (4 days ago) [Divya Chandralekha] |/ / * | 9345e5a - Merge pull request #43 from omaaartamer/fix/alignment-warnings (5 days ago) [Divya Kumaran Chandralekha] * | eedb772 - [stp] Add memory alignment padding to structures (9 weeks ago) [omaaartamer] * | 128e53d - fix: resolve STP alignment warnings (9 weeks ago) [omaaartamer] / * 30febfa - Fixing changes in the code (9 weeks ago) [Wajahat Razi] ``` #### How I did it #### How to verify it #### Description for the changelog
stepanblyschak
pushed a commit
that referenced
this pull request
Oct 1, 2025
…sonic-net#23653) #### Why I did it src/dhcpmon ``` * 35a907b - (HEAD -> 202505, origin/202505) [build] Update to install libyang3 in PR check (#47) (2 days ago) [mssonicbld] ``` #### How I did it #### How to verify it #### Description for the changelog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
lazy_re had an issue when importing sonic-cfggen in another application that
uses re.search():
There is no much imporvement of lazy_re today after many other good optimization work
done for sonic-cfggen. It served as a quick temporary solution.
Some quick test for fast-reboot and warm-reboot done on top of 201911 branch:
Fast-reboot: from ASIC reset to ports in up state:
with lazy_re: 18 sec
without lazy_re: 18 sec
Warm-reboot: LAG restoration time:
with lazy_re: 73 sec
without lazy_re: 72 sec
So, there is no real optimization since the number of sonic-cfggen is grately reduced
in latest SONiC. This means it is time to revert this change.
Signed-off-by: Stepan Blyschak [email protected]
Why I did it
Remove W/A that I introduced a while ago that seems no longer needed nor gives some improvement.
How I did it
Removed lazy_re.
How to verify it
Ran fast-reboot, warm-reboot and do not observe degradations.
Which release branch to backport (provide reason below if selected)
Description for the changelog
A picture of a cute animal (not mandatory but encouraged)