Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix exception when running snmp subagent under python3.7 (#130)
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):#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())#12 File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete#012 return future.result()#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)#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)#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.
- Loading branch information