Closed Ktmi closed 5 months ago
Still getting the same error in the SDN trace e2e tests. Not sure why. Will rerun without this patch and see if the issue persists.
E2E tests on SDN trace fails whether I have this patch applied or not.
E2E tests on SDN trace fails whether I have this patch applied or not.
@Ktmi the nightly e2e tests have been passing for more than 2 weeks. Maybe it might be a sleep that's impacting when executing on your laptop? Either way, if it's failing it might be worth mapping an issue for it if you haven't yet, just so it can be improved. It's also worth dispatching an execution on GitLab https://gitlab.ampath.net/amlight/kytos-end-to-end-tester/-/pipelines with this branch here just so you can also have more information when opening the issue.
E2E tests on SDN trace fails whether I have this patch applied or not.
@Ktmi the nightly e2e tests have been passing for more than 2 weeks. Maybe it might be a sleep that's impacting when executing on your laptop? Either way, if it's failing it might be worth mapping an issue for it if you haven't yet, just so it can be improved. It's also worth dispatching an execution on GitLab https://gitlab.ampath.net/amlight/kytos-end-to-end-tester/-/pipelines with this branch here just so you can also have more information when opening the issue.
If you set this env var ENV_VARS
with this value --build-arg branch_kytos=feat/rate_limited_buffers
and dispatch the GitLab pipeline it should run all the e2e tests with this branch.
Other than that I also simulated a wrong configuration and it exited kytosd
as expected:
Web update - Web UI was not updated
2023-10-17 15:18:27,786 - INFO [kytos.core.db] [db.py:152:db_conn_wait] (MainThread) Starting DB connection
2023-10-17 15:18:27,787 - INFO [kytos.core.db] [db.py:137:_mongo_conn_wait] (MainThread) Trying to run 'hello' command on MongoDB...
2023-10-17 15:18:27,795 - INFO [kytos.core.db] [db.py:139:_mongo_conn_wait] (MainThread) Ran 'hello' command on MongoDB successfully. It's ready!
2023-10-17 15:18:27,805 - INFO [kytos.core.api_server] [api_server.py:429:_start_endpoint] (MainThread) Started /api/kytos/core/auth/login/ - GET
2023-10-17 15:18:27,806 - INFO [kytos.core.api_server] [api_server.py:429:_start_endpoint] (MainThread) Started /api/kytos/core/auth/users/ - GET
2023-10-17 15:18:27,806 - INFO [kytos.core.api_server] [api_server.py:429:_start_endpoint] (MainThread) Started /api/kytos/core/auth/users/{username} - GET
2023-10-17 15:18:27,806 - INFO [kytos.core.api_server] [api_server.py:429:_start_endpoint] (MainThread) Started /api/kytos/core/auth/users/ - POST
Kytos couldn't start because of 'rate_limitedx' Traceback (most recent call last):
File "/home/viniarck/repos/kytos/kytos/core/controller.py", line 264, in start
self.start_controller()
File "/home/viniarck/repos/kytos/kytos/core/controller.py", line 342, in start_controller
self._buffers = KytosBuffers()
File "/home/viniarck/repos/kytos/kytos/core/buffers/manager.py", line 60, in __init__
setattr(self, name, buffer_from_config(name, config))
File "/home/viniarck/repos/kytos/kytos/core/buffers/factory.py", line 89, in buffer_from_config
processed_conf = buffer_conf_processors[buffer_type](config)
KeyError: 'rate_limitedx'
Task was destroyed but it is pending!
task: <Task pending name='Task-1' coro=<start_shell_async() running at /home/viniarck/repos/kytos/kytos/core/kytosd.py:120>>
2023-10-17 15:18:27,806 - INFO [kytos.core.api_server] [api_server.py:429:_start_endpoint] (MainThread) Started /api/kytos/core/auth/users/{username} - DELETE
2023-10-17 15:18:27,806 - INFO [kytos.core.api_server] [api_server.py:429:_start_endpoint] (MainThread) Started /api/kytos/core/auth/users/{username} - PATCH
2023-10-17 15:18:27,806 - INFO [kytos.core.controller] [controller.py:282:create_pidfile] (MainThread) /home/viniarck/repos/kytos/.direnv/python-3.9/var/run/kytos
2023-10-17 15:18:27,807 - INFO [kytos.core.controller] [controller.py:340:start_controller] (MainThread) Starting Kytos - Kytos Controller
2023-10-17 15:18:27,810 - ERROR [kytos.core.controller] [kytosd.py:156:async_main] (MainThread) Kytos couldn't start because of 'rate_limitedx' Traceback (most recent call last):
File "/home/viniarck/repos/kytos/kytos/core/controller.py", line 264, in start
self.start_controller()
File "/home/viniarck/repos/kytos/kytos/core/controller.py", line 342, in start_controller
self._buffers = KytosBuffers()
File "/home/viniarck/repos/kytos/kytos/core/buffers/manager.py", line 60, in __init__
setattr(self, name, buffer_from_config(name, config))
File "/home/viniarck/repos/kytos/kytos/core/buffers/factory.py", line 89, in buffer_from_config
processed_conf = buffer_conf_processors[buffer_type](config)
KeyError: 'rate_limitedx'
/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
2023-10-17 15:18:27,810 - INFO [kytos.core.controller] [kytosd.py:157:async_main] (MainThread) Shutting down Kytos...
Gonna close this one, and reopen a new PR, in order to integrate the changes from #438.
Closes #245.
Summary
This patch implements a rate limited
KytosEventBuffer
through the usage of thelimits
package.Local Tests
I was trying to test writing many flows to
stored_flows
, however, at the moment, I get a pymongo error on theflow_manager
side of things. Otherwise, normal tasks like creating EVCs seem to work well.End-To-End Tests
The following are the end to end test results: