Fix exception when running snmp subagent under python3.7#130
Merged
qiluo-msft merged 1 commit intosonic-net:masterfrom May 6, 2020
Merged
Fix exception when running snmp subagent under python3.7#130qiluo-msft merged 1 commit intosonic-net:masterfrom
qiluo-msft merged 1 commit intosonic-net:masterfrom
Conversation
May 5 21:35:16.852142 sonic ERR snmp#snmp-subagent [sonic_ax_impl] ERROR: Uncaught exception in sonic_ax_impl.main#012Traceback (most recent call last):sonic-net#12 File "/usr/local/lib/python3.7/dist-packages/sonic_ax_impl/main.py", line 70, in main#012 event_loop.run_until_complete(agent.run_in_event_loop())sonic-net#12 File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete#012 return future.result()sonic-net#12 File "/usr/local/lib/python3.7/dist-packages/ax_interface/agent.py", line 37, in run_in_event_loop#012 background_task = self.mib_table.start_background_tasks(self.oid_updaters_enabled)sonic-net#12 File "/usr/local/lib/python3.7/dist-packages/ax_interface/mib.py", line 276, in start_background_tasks#012 task = event._loop.create_task(fut)sonic-net#12 File "/usr/lib/python3.7/asyncio/base_events.py", line 405, in create_task#012 task = tasks.Task(coro, loop=self)#012TypeError: a coroutine was expected, got <Task pending coro=<MIBUpdater.start() running at /usr/local/lib/python3.7/dist-packages/ax_interface/mib.py:34> cb=[MIBTable._done_background_task_callback() at /usr/local/lib/python3.7/dist-packages/ax_interface/mib.py:263]> We really do not need to wrap the future within a task. This also addresses the issue where the subagent would not exit on SIGTERM. Signed-off-by: Joyas Joseph <joyas_joseph@dell.com>
Contributor
Author
|
This change has been verified in both pyhton3.6 and python3.7 |
qiluo-msft
approved these changes
May 6, 2020
ssithaia-ebay
pushed a commit
to ssithaia-ebay/sonic-snmpagent
that referenced
this pull request
May 23, 2025
May 5 21:35:16.852142 sonic ERR snmp#snmp-subagent [sonic_ax_impl] ERROR: Uncaught exception in sonic_ax_impl.main#012Traceback (most recent call last):sonic-net#12 File "/usr/local/lib/python3.7/dist-packages/sonic_ax_impl/main.py", line 70, in main#012 event_loop.run_until_complete(agent.run_in_event_loop())sonic-net#12 File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete#012 return future.result()sonic-net#12 File "/usr/local/lib/python3.7/dist-packages/ax_interface/agent.py", line 37, in run_in_event_loop#012 background_task = self.mib_table.start_background_tasks(self.oid_updaters_enabled)sonic-net#12 File "/usr/local/lib/python3.7/dist-packages/ax_interface/mib.py", line 276, in start_background_tasks#012 task = event._loop.create_task(fut)sonic-net#12 File "/usr/lib/python3.7/asyncio/base_events.py", line 405, in create_task#012 task = tasks.Task(coro, loop=self)#012TypeError: a coroutine was expected, got <Task pending coro=<MIBUpdater.start() running at /usr/local/lib/python3.7/dist-packages/ax_interface/mib.py:34> cb=[MIBTable._done_background_task_callback() at /usr/local/lib/python3.7/dist-packages/ax_interface/mib.py:263]> We really do not need to wrap the future within a task. This also addresses the issue where the subagent would not exit on SIGTERM.
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.
- What I did
As part of converting the snmp docker to buster, I observed that the snmp subagent exits after throwing an exception.
The change also addresses the issue where snmp subagent doesnt exit on SIGTERM.
- How I did it
Code change.
- How to verify it
Verify that subagent is running in the docker.
snmpwalk -c public -v2c .1.3.6.1.2.1.2.2.1.2
- Description for the changelog
Fix exception when running snmp subagent under python3.7