[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [BUG] xs.watch and xs.unwatch are unreliable

On 01/03/16 20:17, Sergei Lebedev wrote:
> Hi list,
> I’ve initially wanted to report another inconsistency in
> ``xen.lowlevel.xs`` documentation, but this time the issue is more
> subtle.


> Here’s another example with a string token
>     >>> token1 = str(100000000000000000000000000000)
>     >>> token2 = str(100000000000000000000000000000)
>     >>> token1 == token2
>     True
>     >>> h.watch("@introduceDomain", token1)
>     >>> h.unwatch("@introduceDomain", token2)
>     Traceback (most recent call last):
>       File "<stdin>", line 1, in <module>
>     xen.lowlevel.xs.Error: (2, 'No such file or directory’)
> I’m not sure what would be the best way to handle this as there might
> be existing code relying on this undocumented behaviour. What do you
> think?

I think you're stuck with this behaviour.  If you fix it there's a risk
of breaking existing applications by unwatch removing the wrong watch.

Perhaps you could extend the watch API to return a watch object that has
an unwatch() method?

  watch = h.watch("/some/path", "token")


Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.