[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-tools] Re: xenstored crash
On Tue, 2005-09-13 at 22:12 +0100, Christian Limpach wrote: > Rusty, > > could you take a look at the following crash: > (gdb) run -N --pid-file=/var/run/xenstore.pid -T /var/log/xenstored-trace.log > Starting program: /usr/sbin/xenstored -N --pid-file=/var/run/xenstore.pid -T > /var/log/xenstored-trace.log > xenstored: xenstored_core.c:512: send_reply: Assertion `conn->state != > BLOCKED' failed. And here's the one-line fix, plus test case. Rusty. # HG changeset patch # User Rusty Russell <rusty@xxxxxxxxxxxxxxx> # Node ID 7882eb8eec92a90929904a9daa7857a2ce44f294 # Parent 0d8c0db042580571be501be5b59cb5beb8417cef Fix Christian's xenstored watch crash. When a connection blocked waiting on a transaction, don't queue watch events. Sure, they'd be ignored and re-transmitted, but it hits an assert that we don't send data out blocked connections, and it's wasteful. Signed-off-by: Rusty Russell <rusty@xxxxxxxxxxxxxxx> (authored) diff -r 0d8c0db04258 -r 7882eb8eec92 tools/xenstore/xenstored_watch.c --- a/tools/xenstore/xenstored_watch.c Tue Sep 13 21:52:24 2005 +++ b/tools/xenstore/xenstored_watch.c Wed Sep 14 05:07:51 2005 @@ -144,7 +144,7 @@ else continue; /* If connection not doing anything, queue this. */ - if (!i->out) + if (i->state == OK) queue_next_event(i); } } diff -r 0d8c0db04258 -r 7882eb8eec92 tools/xenstore/xs_test.c --- a/tools/xenstore/xs_test.c Tue Sep 13 21:52:24 2005 +++ b/tools/xenstore/xs_test.c Wed Sep 14 05:07:51 2005 @@ -398,12 +398,16 @@ static void do_readack(unsigned int handle) { enum xsd_sockmsg_type type; - char *ret; - - ret = read_reply(handles[handle]->fd, &type, NULL); - if (!ret) - failed(handle); - free(ret); + char *ret = NULL; + + /* Watches can have fired before reply comes: daemon detects + * and re-transmits, so we can ignore this. */ + do { + free(ret); + ret = read_reply(handles[handle]->fd, &type, NULL); + if (!ret) + failed(handle); + } while (type == XS_WATCH_EVENT); } static void do_setid(unsigned int handle, char *id) diff -r 0d8c0db04258 -r 7882eb8eec92 tools/xenstore/testsuite/16block-watch-crash.test --- /dev/null Tue Sep 13 21:52:24 2005 +++ b/tools/xenstore/testsuite/16block-watch-crash.test Wed Sep 14 05:07:51 2005 @@ -0,0 +1,13 @@ +# Test case where blocked connection gets sent watch. + +mkdir /test +watch /test token +1 start /test +# This will block on above +noackwrite /test/entry create contents +1 write /test/entry2 create contents +1 commit +readack +expect /test/entry2:token +waitwatch +ackwatch token -- A bad analogy is like a leaky screwdriver -- Richard Braakman _______________________________________________ Xen-tools mailing list Xen-tools@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-tools
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |