All of lore.kernel.org
 help / color / mirror / Atom feed
From: Razvan Cojocaru <rcojocaru@bitdefender.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: stefano.stabellini@eu.citrix.com, wei.liu2@citrix.com,
	xen-devel@lists.xen.org
Subject: Re: [PATCH V2] tools/xenstore-watch: Add new timeout parameter
Date: Thu, 17 Mar 2016 18:46:18 +0200	[thread overview]
Message-ID: <56EADF5A.8080701@bitdefender.com> (raw)
In-Reply-To: <22250.56759.655965.841132@mariner.uk.xensource.com>

On 03/17/2016 06:39 PM, Ian Jackson wrote:
> Razvan Cojocaru writes ("[PATCH V2] tools/xenstore-watch: Add new timeout parameter"):
>> This patch allows xenstore-watch to exit even if no changes to its
>> XenStore key have occured in a specified interval (in seconds), via
>> a new -T parameter.
> 
> I realise I come a bit late with this, but:
> 
> I'm not opposed to making it possible to wait with a timeout for a
> suitable situation in xenstore.
> 
> However, xenstore-watch needs to be run in a loop because of the
> possibility of spurious watch triggers.  And this means that to use
> your new option and get the timeout right, the caller would need to
> write shell code to query the time, do arithmetic to calculate the
> appropriate timeout, and so on.
> 
> Or to put it another way, xenstore-watch is a fine debugging and
> monitoring tool but not very good for scripting.
> 
> For scripting what you probably want is something like:
> 
>   "wait up to T seconds for xenstore node /X/Y/Z
>    to contain something matching PAT; bail immediately if
>    /X/Y/Z contains something matching QAT".
> 
> How are you using this new option ?

I've actually ended up doing something very similar to what you're
describing, so this is no longer needed here, but I thought that it
might benefit someone in the community so I've carried on.

I basically wanted to be able to shut a program down via writing to a
XenStore key - the program acknowledges that it shut down by removing
the key, but it could also crash before it does that. So in that worst
case scenario, I didn't want xenstore-watch to wait forever. If you
don't feel that's a valid use for it I don't mind dropping the patch,
but I think it might benefit someone.


Thanks,
Razvan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

      reply	other threads:[~2016-03-17 16:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-17  8:55 [PATCH V2] tools/xenstore-watch: Add new timeout parameter Razvan Cojocaru
2016-03-17 16:39 ` Ian Jackson
2016-03-17 16:46   ` Razvan Cojocaru [this message]

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=56EADF5A.8080701@bitdefender.com \
    --to=rcojocaru@bitdefender.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /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.