rabbit_db_vhost: Add `no_return()` to `update/2` spec
This function throws if the database fails to apply the transaction. This function is only called by the `rabbit_vhost_limit` runtime parameter module in its `notify/5` and `notify_clear/4` callbacks. These callers have no way of handling this error but it should be very difficult for them to face this crash: setting the runtime parameter would need to succeed first which needs Khepri to be in majority. Khepri would need to enter a minority between inserting/updating/deleting the runtime parameter and updating the vhost. It's possible but unlikely. In the future we could consider refactoring vhost limits to update the vhost as the runtime parameter is changed, transactionally. I figure that to be a very large change though so we leave this to the future.
This commit is contained in:
		
							parent
							
								
									4fd77d5fbf
								
							
						
					
					
						commit
						2a86dde998
					
				|  | @ -349,7 +349,7 @@ list_in_khepri() -> | ||||||
| -spec update(VHostName, UpdateFun) -> VHost when | -spec update(VHostName, UpdateFun) -> VHost when | ||||||
|       VHostName :: vhost:name(), |       VHostName :: vhost:name(), | ||||||
|       UpdateFun :: fun((VHost) -> VHost), |       UpdateFun :: fun((VHost) -> VHost), | ||||||
|       VHost :: vhost:vhost(). |       VHost :: vhost:vhost() | no_return(). | ||||||
| %% @doc Updates an existing virtual host record using the result of | %% @doc Updates an existing virtual host record using the result of | ||||||
| %% `UpdateFun'. | %% `UpdateFun'. | ||||||
| %% | %% | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue