Skip to content
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

Other NApps loading in unexpected order results in Error once event bus starts. #38

Open
Ktmi opened this issue Aug 13, 2024 · 3 comments · May be fixed by #45
Open

Other NApps loading in unexpected order results in Error once event bus starts. #38

Ktmi opened this issue Aug 13, 2024 · 3 comments · May be fixed by #45
Assignees
Labels
bug Something isn't working enhancement New feature or request future_release

Comments

@Ktmi
Copy link
Contributor

Ktmi commented Aug 13, 2024

So from what I can tell, other NApps that use of_multi_table are loading in after this NApp has loaded. of_multi_table uses the list of currently loaded NApps to know which NApps it should wait on before updating their flow tables. However, since these NApps can load in after of_multi_table has already checked the loaded NApps, then of_multi_table, will not wait for them.

In addition to the above, the following error is produced when this occurs:

2024-08-13 20:54:43,938 - INFO [kytos.core.controller] (MainThread) Event handler meta started
2024-08-13 20:54:43,962 - INFO [uvicorn.error] (MainThread) Application startup complete.
2024-08-13 20:54:43,989 - ERROR [kytos.core.helpers] (thread_pool_app_10) listen_to handler: <function Main.on_enable_table at 0x7f11c07c8c20>, args: (<Main(of_multi_table, stopped 139711704090304)>, KytosEvent('kytos/telemetry_int.enable_table', {'group_table': {'evpl': 2, 'epl': 3}}, 0)) traceback: Traceback (most recent call last):,   File "/home/ktmi/kytos-project/kytos/kytos/core/helpers.py", line 141, in handler_context,     result = handler(*args),              ^^^^^^^^^^^^^^,   File "/home/ktmi/kytos-project/kenv/var/lib/kytos/napps/kytos/of_multi_table/main.py", line 128, in on_enable_table,     self.handle_enable_table(event),   File "/home/ktmi/kytos-project/kenv/var/lib/kytos/napps/kytos/of_multi_table/main.py", line 135, in handle_enable_table,     self.required_napps.remove(napp), KeyError: 'telemetry_int', 
2024-08-13 20:54:43,990 - ERROR [kytos.core.helpers] (thread_pool_app_9) listen_to handler: <function Main.on_enable_table at 0x7f11c07c8c20>, args: (<Main(of_multi_table, stopped 139711704090304)>, KytosEvent('kytos/of_lldp.enable_table', {'group_table': {'base': 0}}, 0)) traceback: Traceback (most recent call last):,   File "/home/ktmi/kytos-project/kytos/kytos/core/helpers.py", line 141, in handler_context,     result = handler(*args),              ^^^^^^^^^^^^^^,   File "/home/ktmi/kytos-project/kenv/var/lib/kytos/napps/kytos/of_multi_table/main.py", line 128, in on_enable_table,     self.handle_enable_table(event),   File "/home/ktmi/kytos-project/kenv/var/lib/kytos/napps/kytos/of_multi_table/main.py", line 135, in handle_enable_table,     self.required_napps.remove(napp), KeyError: 'of_lldp', 
2024-08-13 20:54:43,990 - ERROR [kytos.core.helpers] (thread_pool_app_9) listen_to handler: <function Main.on_enable_table at 0x7f11c07c8c20>, args: (<Main(of_multi_table, stopped 139711704090304)>, KytosEvent('kytos/coloring.enable_table', {'group_table': {'base': 0}}, 0)) traceback: Traceback (most recent call last):,   File "/home/ktmi/kytos-project/kytos/kytos/core/helpers.py", line 141, in handler_context,     result = handler(*args),              ^^^^^^^^^^^^^^,   File "/home/ktmi/kytos-project/kenv/var/lib/kytos/napps/kytos/of_multi_table/main.py", line 128, in on_enable_table,     self.handle_enable_table(event),   File "/home/ktmi/kytos-project/kenv/var/lib/kytos/napps/kytos/of_multi_table/main.py", line 135, in handle_enable_table,     self.required_napps.remove(napp), KeyError: 'coloring', 
@viniarck viniarck added enhancement New feature or request bug Something isn't working labels Aug 14, 2024
@viniarck
Copy link
Member

viniarck commented Aug 14, 2024

Good finding. Yes, it shouldn't crash and handle the self.required_napps.remove(napp) potential KeyError accordingly.

The assumption of this NApp on its current version is that indeed it's always loaded last, if you encountered other errors while still loading it last let us know that it deserves to be prioritized.

@italovalcy
Copy link

Hi guys,

I'm facing the same error here:

Jan 16 19:39:09 a8f3cbcff197 kytos.core.helpers:ERROR helpers:147:  listen_to handler: <function Main.on_enable_table at 0x7f7dc8615dc0>, args: (<Main(of_multi_table, stopped 140173941651200)>, KytosEvent('kytos/mef_eline.enable_table', {'group_table': {'epl': 0, 'evpl': 0}}, 0)) traceback: Traceback (most recent call last):,   File "/usr/local/lib/python3.9/dist-packages/kytos/core/helpers.py", line 143, in handler_context,     result = handler(*args),   File "//var/lib/kytos/napps/kytos/of_multi_table/main.py", line 127, in on_enable_table,     self.handle_enable_table(event),   File "//var/lib/kytos/napps/kytos/of_multi_table/main.py", line 134, in handle_enable_table,     self.required_napps.remove(napp), KeyError: 'mef_eline',

It looks like mef_eline loaded before of_multi_table update the required_napps

@viniarck
Copy link
Member

@Alopalao assigning this to you, no need for immediate action, keep on with the other higher priority issues you have. But then when you have bandwith let's try to solve this since this NApp is still being maintained and tested. It needs better handling in that part, even though it's expected that mef_eline will load first.

@Alopalao Alopalao linked a pull request Feb 3, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request future_release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants