CP-51692: Do not enable Event.next ratelimiting if Event.next is still used internally #6222
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.
This fixes a performance regression on
feature/perf
with all feature flags disabled.By default Event.next is still used internally, so although this API is deprecated do not yet enable the throttling by default. Fixes: 3e1d8a2 ("CP-51692: Event.next: use same batching as Event.from")
Fixes: 2b4e0db ("CP-49158: [prep] Event.{from,next}: make delays configurable and prepare for task specific delays")
It slows down all synchronous API calls that create tasks, like VM.start.
Only enable the throttling when Event.next is not used internally (
use-event-next = false
in xapi.conf), which will eventually become the default.The code prior to the above changes used 0 delay between checking for events, so do the same here (although this lead to a lot of inefficient wakeups of all active tasks in XAPI, whenever anything changes, it matches previous behaviour)
(the code for Event.from used a 50ms delay, which matches the default for that setting already)