Skip to content

CA-407564: Reintroduce try/with in Xapi_event #6345

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

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions ocaml/xapi/xapi_event.ml
Original file line number Diff line number Diff line change
Expand Up @@ -655,18 +655,20 @@ let from_inner __context session subs from from_t timer batching =
in
let events_of ~kind ?(with_snapshot = true) entries acc =
let rec go events ({table; obj; time= _} as entry) =
let snapshot =
let serialiser = Eventgen.find_get_record table in
if with_snapshot then
serialiser ~__context ~self:obj ()
try
let snapshot =
let serialiser = Eventgen.find_get_record table in
if with_snapshot then
serialiser ~__context ~self:obj ()
else
None
in
let event = event_of kind ?snapshot entry in
if Subscription.event_matches subs event then
event :: events
else
None
in
let event = event_of kind ?snapshot entry in
if Subscription.event_matches subs event then
event :: events
else
events
events
with _ -> events
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to log this? Might want to add a comment why they can be ignored and don't represent a problem.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we want to log it when the kind is not del, when the kind is 'del' I think it is expected that find_get_record would fail.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe this is happening on mod races, haven't been able to repro this through the python API, but booting/shutting down VMs in parallel causes XenCenter to lose connection quite often

in
List.fold_left go acc entries
in
Expand Down
Loading