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

Updating of interface tags does not guarantee write to DB #237

Open
Ktmi opened this issue Nov 25, 2024 · 1 comment
Open

Updating of interface tags does not guarantee write to DB #237

Ktmi opened this issue Nov 25, 2024 · 1 comment

Comments

@Ktmi
Copy link

Ktmi commented Nov 25, 2024

Updating the tags of an interface generates an event, which is then later processed by topology to write the tag data to the DB. However, it is possible that before this event is processed kytos can crash or shutdown, or some other event can occur which prevents the write to the DB. This can lead to scenarios where another NApp reserves a tag, writes to the DB that it reserved a given tag, then kytos closes before the fact that the tag is in use is registered by topology.

@viniarck
Copy link
Member

viniarck commented Dec 2, 2024

The the threadpool executors currently gracefully shutdown when the controller is stopped. So, for sigterm and sigint, it's expected to handle well. For sigkill, there's no guarantee in the application, incorrect state or corruption can happen if an admin doesn't manage it correctly.

We can consider in a next future opportunity to perform upsert_interface_details in the core, and then only allow the method to succeed if the DB write succeeded as you pointed out. Let's consider this low priority for now since the likelyhood of that one to blow up is low, and events out of order are already being handled.

In the meantime what can be done to also make it less prone to starvation in the app default pool would be to set that topology handler to use the db pool as it should've been from the start when it was introduced.

Good finding.

@viniarck viniarck added the priority_low Low priority label Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants