All of lore.kernel.org
 help / color / mirror / Atom feed
From: John McCullough <jmccullo@cs.ucsd.edu>
To: xen-devel@lists.xensource.com
Subject: Re: XenStore Watch Behavior
Date: Mon, 28 Aug 2006 19:22:52 -0700	[thread overview]
Message-ID: <20060829022252.GG23281@cs.ucsd.edu> (raw)
In-Reply-To: <20060829004830.GC23281@cs.ucsd.edu>

On Mon, Aug 28, 2006 at 05:48:31PM -0700, John McCullough wrote:
> On Sun, Aug 27, 2006 at 03:57:06PM +0100, Keir Fraser wrote:
> > On 26/8/06 9:32 pm, "John McCullough" <jmccullo@cs.ucsd.edu> wrote:
> > 
> > >     What is the intended behavior of watches on the XenStore?  Should
> > > only one watch be allowed on a given sub-hierarchy?  Should the most
> > > specific watch be triggered alone?  Should all watches be triggered?
> > 
> > I believe it's all supposed to work in a very obvious and simple way: All
> > watches registered on a prefix of the updated node's path should be fired. A
> > single transaction can fire the same watch multiple times if that watch is
> > on a common prefix of a number of nodes updated by that transaction (since
> > each firing event specifies the full path of the modified node, so events
> > can't really be merged).
> > 
> > If you observe different behaviour from this then it is most likely a bug
> > and we would love to receive patches!
> >
> 
> I am attaching a band-aid style patch for xswatch.  I haven't dug very
> far into the xenstore code yet, and I'm not sure how much time I have to
> dedicate on this quite yet.
> 
> What this patch addresses is xswatch's tendency to receive watches for
> non-xswatch created watches with those tokens.  Is the indended behavior
> of read_watch to pick up on all available watches and leave you to
> discriminate which to service based on token?
>

Recently I discovered that my watch and the xswatch were receiving
alternating watches (both in python).  Looking at xs_read_watch in 
tools/xenstore/xs.c, the mutex on the xshandle forces all xs_read_watch
calls to take turns.  Given that the python interface shares a single
xshandle, this prevents multiple watches.

Creating an entirely new xshandle for each use of read_watch works.
Moving to a model where the xsutil.xshandle() call creates a new
xshandle seems easily supportable, given that xswatch is primarily used,
and it keeps a reference to it's own handle.

Does anyone know of other xshandle() uses that warrant the current
behavior?

Regards,
John

  parent reply	other threads:[~2006-08-29  2:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-26 20:32 XenStore Watch Behavior John McCullough
2006-08-27 14:57 ` Keir Fraser
2006-08-29  0:48   ` John McCullough
2006-08-29  0:52     ` John McCullough
2006-08-29  2:22     ` John McCullough [this message]
2006-08-29  6:27       ` Keir Fraser
2006-08-29  9:15       ` Ewan Mellor
2006-08-29 19:12         ` John McCullough
2006-08-29 19:42           ` Ewan Mellor
2006-08-29 23:35             ` John McCullough

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060829022252.GG23281@cs.ucsd.edu \
    --to=jmccullo@cs.ucsd.edu \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.