-
Notifications
You must be signed in to change notification settings - Fork 284
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
CP-51692: use Event.from instead of Event.next #6125
Conversation
No functional change. Signed-off-by: Edwin Török <[email protected]>
…n flag This is more efficient: we can watch a single task, instead of everything in the DB. Feature-flag: use-event-next No functional change. Signed-off-by: Edwin Török <[email protected]>
int32_of_rpc doesn't accept Int32 as input, just Int because none of the current deserializers actually produce an Int32. (Int32 is only used by serializers to emit something different). This is an upstream ocaml-rpc bug that should be fixed, meanwhile convert Rpc.Int32 to Rpc.Int, so that the 'fake_rpc' inside XAPI can use Event.from. Otherwise you get this error: ``` Expected int32, got 'I32(0) ``` Signed-off-by: Edwin Török <[email protected]>
…vent.next This is more efficient: we can watch a single task, instead of everything in the DB. Feature-flag: use-event-next Signed-off-by: Edwin Török <[email protected]>
|
The above comment should go into the API documentation |
… of Event.next Feature flag: use-event-next Signed-off-by: Edwin Török <[email protected]>
6a97fd6
to
ace50ae
Compare
Upstream bugfix here: mirage/ocaml-rpc#182, though probably still useful to keep the workaround too for now. |
Describe EVENTS_LOST in Event.next. Remove EVENTS_LOST and SESSION_NOT_REGISTERED from Event.from: these are only raised by Event.next. Document the actual errors that Event.from can raise. As requested in #6125 (comment), based on #6125 (comment)
Event.next can lose events, and we try to encourage our API users to always use Event.from instead. My understanding (which could be wrong) is that Event.from will give you the events since a given point in time (token), whereas Event.next only gives you even from when you called the API (missing events between API calls). This PR introduces a feature flag that we can use to switch the interal users of Event.next to Event.from. Doing so I've discovered a bug in ocaml-rpc, where `int32_of_rpc` doesn't accept Int32 as input, just Int. There is a workaround here for now, but I intend to fix this upstream instead, hence the draft PR.
Event.next can lose events, and we try to encourage our API users to always use Event.from instead.
My understanding (which could be wrong) is that Event.from will give you the events since a given point in time (token), whereas Event.next only gives you even from when you called the API (missing events between API calls).
This PR introduces a feature flag that we can use to switch the interal users of Event.next to Event.from.
Doing so I've discovered a bug in ocaml-rpc, where
int32_of_rpc
doesn't accept Int32 as input, just Int.There is a workaround here for now, but I intend to fix this upstream instead, hence the draft PR.