Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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 87648c83e494b0c31aff41181e20a45d46f677b3 1 parent e1b296a
Jon Ludlam authored October 08, 2012

Showing 1 changed file with 2 additions and 3 deletions. Show diff stats Hide diff stats

  1. 5  ocaml/xapi/xapi_event.ml
5  ocaml/xapi/xapi_event.ml
@@ -324,15 +324,14 @@ let from ~__context ~classes ~token ~timeout =
324 324
 		objs
325 325
 	in
326 326
 
327  
-	let all_subs = Mutex.execute sub.m (fun () -> Hashtbl.fold (fun _ s acc -> s.subs @ acc) subscriptions []) in
328  
-	let tables = List.filter (fun table -> table_matches all_subs table) all_event_tables in
  327
+	let tables = List.filter (fun table -> table_matches sub.subs table) all_event_tables in
329 328
 
330 329
 	let events_lost = ref [] in
331 330
 
332 331
 	let grab_range t =
333 332
 		let tableset = Db_cache_types.Database.tableset (Db_ref.get_database t) in
334 333
 		let (msg_gen,messages) =
335  
-			if table_matches all_subs "message" then (!message_get_since_for_events) ~__context sub.last_msg_gen else (0L, []) in
  334
+			if table_matches sub.subs "message" then (!message_get_since_for_events) ~__context sub.last_msg_gen else (0L, []) in
336 335
 		(msg_gen, messages, tableset, List.fold_left
337 336
 			(fun acc table ->
338 337
 				 Db_cache_types.Table.fold_over_recent sub.last_generation

0 notes on commit 87648c8

Please sign in to comment.
Something went wrong with that request. Please try again.