This PR is on top of #438 since it depends on event_buffer_conf.
Summary
See updated changelog file (it also explains how to use it)
Local Tests
I ran kytosd with my local env, still worked as it used to.
I've also explored configurations on kytos.conf it's behaving as expected
I then simulated a NApp misbehaving by sending too many events during setup() with mef_eline. Notice below that you can see exactly which producer couldn't put the event anymore, and then in the tracebacks it also includes who may events it had, which other events ended up filling the queue, in this case `kytos/mef_eline.xyz' had more than a 1000:
Kytos couldn't start because of KytosNAppSetupException: NApp kytos/mef_eline exception Traceback (most recent call last):
File "/home/viniarck/repos/kytos/kytos/core/controller.py", line 817, in load_napp
napp = napp_module.Main(controller=self)
File "/home/viniarck/repos/kytos/kytos/core/napps/base.py", line 194, in __init__
self.setup()
File "/home/viniarck/repos/napps/napps/kytos/mef_eline/main.py", line 72, in setup
self.send_events(1024)
File "/home/viniarck/repos/napps/napps/kytos/mef_eline/main.py", line 76, in send_events
self.controller.buffers.app.put(KytosEvent("kytos/mef_eline.xyz"), timeout=1)
File "/home/viniarck/repos/kytos/kytos/core/buffers/buffers.py", line 40, in put
self._queue.sync_q.put(event, timeout=timeout)
File "/home/viniarck/repos/kytos/.direnv/python-3.9/lib/python3.9/site-packages/janus/__init__.py", line 388, in put
raise SyncQueueFull
queue.Full
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/viniarck/repos/kytos/kytos/core/controller.py", line 263, in start
self.start_controller()
File "/home/viniarck/repos/kytos/kytos/core/controller.py", line 360, in start_controller
self.load_napps()
File "/home/viniarck/repos/kytos/kytos/core/controller.py", line 852, in load_napps
self.load_napp(napp.username, napp.name)
File "/home/viniarck/repos/kytos/kytos/core/controller.py", line 820, in load_napp
raise KytosNAppSetupException(msg) from exc
kytos.core.exceptions.KytosNAppSetupException: KytosNAppSetupException: NApp kytos/mef_eline exception
Full KytosEventBuffers counters: {'app': Counter({'kytos/mef_eline.xyz': 1003, 'kytos/topology.port.created': 19, 'kytos/topology.topology_loaded': 1, 'kytos/mef_eline.evcs_loaded': 1})
}
Shutting down Kytos...
[1] 36965 terminated kytosd -f -n /home/viniarck/repos/napps/napps -E --database mongodb
End-to-End Tests
I'll dispatch e2e execution with this branch and the other NApps PR which are using timeout=1 when putting events during setup():
Closes #423
This PR is on top of #438 since it depends on
event_buffer_conf
.Summary
See updated changelog file (it also explains how to use it)
Local Tests
I ran
kytosd
with my local env, still worked as it used to.I've also explored configurations on kytos.conf it's behaving as expected
I then simulated a NApp misbehaving by sending too many events during
setup()
withmef_eline
. Notice below that you can see exactly which producer couldn't put the event anymore, and then in the tracebacks it also includes who may events it had, which other events ended up filling the queue, in this case`kytos/mef_eline.xyz'
had more than a 1000:End-to-End Tests
I'll dispatch e2e execution with this branch and the other NApps PR which are using
timeout=1
when putting events duringsetup()
: