Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

CA-91930: Remove union of subscriptions between event.from invocations.

This fixes an issue whereby when parallel event.from calls were being
processed, each call would get the union of events meant for each. This
causes particular problems when XenCenter is connected as it registers
for _all_ events. Therefore any other calls made to event.from will
receive _all_ events whenever the GUI is connected. Additionally, as
there is no way to generate a token for 'now', this means that the
initial call to event.from will dump the _entire_ database, including
all the messages, requiring reading these from the disk.

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
  • Loading branch information...
commit 2066206b99f78283869e413f6761fa8fa11d9739 1 parent e6de369
@jonludlam jonludlam authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 ocaml/xapi/xapi_event.ml
View
5 ocaml/xapi/xapi_event.ml
@@ -324,15 +324,14 @@ let from ~__context ~classes ~token ~timeout =
objs
in
- let all_subs = Mutex.execute sub.m (fun () -> Hashtbl.fold (fun _ s acc -> s.subs @ acc) subscriptions []) in
- let tables = List.filter (fun table -> table_matches all_subs table) all_event_tables in
+ let tables = List.filter (fun table -> table_matches sub.subs table) all_event_tables in
let events_lost = ref [] in
let grab_range t =
let tableset = Db_cache_types.Database.tableset (Db_ref.get_database t) in
let (msg_gen,messages) =
- if table_matches all_subs "message" then (!message_get_since_for_events) ~__context sub.last_msg_gen else (0L, []) in
+ if table_matches sub.subs "message" then (!message_get_since_for_events) ~__context sub.last_msg_gen else (0L, []) in
(msg_gen, messages, tableset, List.fold_left
(fun acc table ->
Db_cache_types.Table.fold_over_recent sub.last_generation
Please sign in to comment.
Something went wrong with that request. Please try again.