-
Notifications
You must be signed in to change notification settings - Fork 161
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
[sonic-ycabled]: Fix swsscommon import protobuf error #407
base: master
Are you sure you want to change the base?
Conversation
@vdahiya12 could you review |
``` Current thread 0x00007f4ce5a01740 (most recent call first): File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed File "<frozen importlib._bootstrap_external>", line 1108 in create_module File "<frozen importlib._bootstrap>", line 565 in module_from_spec File "<frozen importlib._bootstrap>", line 666 in _load_unlocked File "<frozen importlib._bootstrap>", line 986 in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 1007 in _find_and_load File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed File "<frozen importlib._bootstrap>", line 1058 in _handle_fromlist File "/usr/lib/python3/dist-packages/swsscommon/swsscommon.py", line 13 in <module> File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed File "<frozen importlib._bootstrap_external>", line 790 in exec_module File "<frozen importlib._bootstrap>", line 680 in _load_unlocked File "<frozen importlib._bootstrap>", line 986 in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 1007 in _find_and_load File "<frozen importlib._bootstrap>", line 228 in _call_with_frames_removed File "<frozen importlib._bootstrap>", line 1058 in _handle_fromlist File "/sonic/src/sonic-platform-daemons/sonic-ycabled/tests/test_y_cable_helper.py", line 3 in <module> File "/usr/lib/python3/dist-packages/_pytest/assertion/rewrite.py", line 170 in exec_module File "<frozen importlib._bootstrap>", line 680 in _load_unlocked File "<frozen importlib._bootstrap>", line 986 in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 1007 in _find_and_load File "<frozen importlib._bootstrap>", line 1030 in _gcd_import File "/usr/lib/python3.9/importlib/__init__.py", line 127 in import_module File "/usr/lib/python3/dist-packages/_pytest/pathlib.py", line 520 in import_path File "/usr/lib/python3/dist-packages/_pytest/python.py", line 552 in _importtestmodule File "/usr/lib/python3/dist-packages/_pytest/python.py", line 484 in _getobj File "/usr/lib/python3/dist-packages/_pytest/python.py", line 288 in obj File "/usr/lib/python3/dist-packages/_pytest/python.py", line 500 in _inject_setup_module_fixture File "/usr/lib/python3/dist-packages/_pytest/python.py", line 487 in collect File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 324 in <lambda> File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 294 in from_call File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 324 in pytest_make_collect_report File "/usr/lib/python3/dist-packages/pluggy/callers.py", line 187 in _multicall File "/usr/lib/python3/dist-packages/pluggy/manager.py", line 83 in <lambda> File "/usr/lib/python3/dist-packages/pluggy/manager.py", line 92 in _hookexec File "/usr/lib/python3/dist-packages/pluggy/hooks.py", line 286 in __call__ File "/usr/lib/python3/dist-packages/_pytest/runner.py", line 441 in collect_one_node File "/usr/lib/python3/dist-packages/_pytest/main.py", line 768 in genitems File "/usr/lib/python3/dist-packages/_pytest/main.py", line 771 in genitems File "/usr/lib/python3/dist-packages/_pytest/main.py", line 568 in _perform_collect File "/usr/lib/python3/dist-packages/_pytest/main.py", line 516 in perform_collect File "/usr/lib/python3/dist-packages/_pytest/main.py", line 306 in pytest_collection File "/usr/lib/python3/dist-packages/pluggy/callers.py", line 187 in _multicall File "/usr/lib/python3/dist-packages/pluggy/manager.py", line 83 in <lambda> File "/usr/lib/python3/dist-packages/pluggy/manager.py", line 92 in _hookexec File "/usr/lib/python3/dist-packages/pluggy/hooks.py", line 286 in __call__ File "/usr/lib/python3/dist-packages/_pytest/main.py", line 295 in _main File "/usr/lib/python3/dist-packages/_pytest/main.py", line 240 in wrap_session File "/usr/lib/python3/dist-packages/_pytest/main.py", line 289 in pytest_cmdline_main File "/usr/lib/python3/dist-packages/pluggy/callers.py", line 187 in _multicall File "/usr/lib/python3/dist-packages/pluggy/manager.py", line 83 in <lambda> File "/usr/lib/python3/dist-packages/pluggy/manager.py", line 92 in _hookexec File "/usr/lib/python3/dist-packages/pluggy/hooks.py", line 286 in __call__ File "/usr/lib/python3/dist-packages/_pytest/config/__init__.py", line 157 in main File "/usr/local/lib/python3.9/dist-packages/ptr.py", line 220 in run_tests File "/usr/local/lib/python3.9/dist-packages/ptr.py", line 209 in run File "/usr/lib/python3.9/distutils/dist.py", line 985 in run_command File "/usr/lib/python3.9/distutils/dist.py", line 966 in run_commands File "/usr/lib/python3.9/distutils/core.py", line 148 in setup File "/usr/local/lib/python3.9/dist-packages/setuptools/__init__.py", line 163 in setup File "/sonic/src/sonic-platform-daemons/sonic-ycabled/setup.py", line 30 in <module> Aborted (core dumped) ``` By GDB and get the error trace of protobuf like : ``` at assert.c:92 function=function@entry=0x7ffff7faa1c0 <__PRETTY_FUNCTION__.0> "__pthread_tpp_change_priority") at assert.c:101 ``` Signed-off-by: Ze Gan <[email protected]>
7472cb6
to
2ade771
Compare
Redesign the dependency with swss_common , So this change isn't needed. |
This issue is raised in a new requirement with sairedis. |
@Pterosaur is this change needed? |
Yes, It's needed in the vs platform again. |
Description
After the PR: sonic-net/sonic-swss-common#837 , the protobuf will be used by swsscommon.
Explicitly import swsscommon before grpc and pytest so that the protobuf global variable will be initialized only once.
Motivation and Context
By GDB and get the error trace of protobuf like :
How Has This Been Tested?
Check by Azp build
Additional Information (Optional)