kytos-ng / kytos

Kytos SDN Platform. Kytos is designed to be easy to install, use, develop and share Network Apps (NApps).
https://kytos-ng.github.io/
MIT License
2 stars 7 forks source link

Try to gracefully cancel task `start_shell_async` when exiting `kytosd` #425

Open viniarck opened 8 months ago

viniarck commented 8 months ago

In some cases such as wrong --database value when terminating kytosd start_shell_async gets destroyed but it's pending, it doesn't cause any other issue, but it'd be great to one day correctly handle this part too, this is very low priority though, but I'll go ahead and map this:

❯ kytosd -f --database mongodbx
Web update - Web UI was not updated
Kytos couldn't start because of KytosDBInitException: DB backend 'mongodbx' isn't supported. Current supported databases: mongodb
Shutting down Kytos...
2023-10-25 09:53:15,817 - INFO [kytos.core.db] [db.py:152:db_conn_wait] (MainThread) Starting DB connection
Task was destroyed but it is pending!
task: <Task cancelling name='Task-1' coro=<start_shell_async() running at /home/viniarck/repos/kytos/kytos/core/kytosd.py:137>>
/home/viniarck/repos/kytos/kytos/core/kytosd.py:98: RuntimeWarning: coroutine 'start_shell_async' was never awaited
  async_main(config)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback