Handle timeouts possible in Khepri minority in rabbit_db_vhost (backport #11706)
#11834
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Like #11685 this handles
{error, timeout}tuples for a database module, this timerabbit_db_vhost.rabbit_db_vhostmostly handles the errors well but needs a few small tweaks to specs and some updates for callers like the management UI.The only problem function in
rabbit_db_vhostisupdate/2which is called by therabbit_vhost_limitruntime parameter module in itsnotify/5andnotify_clear/4callbacks. Those callbacks have no way of passing the error back to the user. Ideally the runtime parameter and vhost records would be updated at the same time transactionally but I think that would be a large refactor. Since you have to modify the runtime parameter in order for the notifications to trigger, it should be a very rare error that we time out just for the vhost update, so I think we can leave a large refactor to future work.Marking this as a draft since it shares 9a71519 with #11685.This is an automatic backport of pull request #11706 done by Mergify.