[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xen-bugs
Subject:    [Xen-bugs] [Bug 968] New: xenstored spinning after EOF
From:       bugzilla-daemon () lists ! xensource ! com
Date:       2007-04-18 18:25:02
Message-ID: bug-968-3 () http ! bugzilla ! xensource ! com/bugzilla/
[Download RAW message or body]

http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=968

           Summary: xenstored spinning after EOF
           Product: Xen
           Version: 3.0.4
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Tools
        AssignedTo: xen-bugs@lists.xensource.com
        ReportedBy: peak@argo.troja.mff.cuni.cz


The following piece of code in handle_input() in
tools/xenstore/xenstored_core.c reads bodies of incoming messages:

        bytes = conn->read(conn, in->buffer + in->used,
                           in->hdr.msg.len - in->used);
        if (bytes < 0)
                goto bad_client;

When a socket connection is broken in the middle of a message body,
conn->read() gets an EOF and returns 0. handle_input() does not kill the
connection and returns to the main loop as if it has been an ordinary
successful partial read. select() in the main loop exits immediately because a
fd is always ready for reading after EOF and calls handle_input() again,
conn->read() returns 0 again, and everything is repeated over and over and...
xenstored starts spinning in the main loop without any sleeping and keeps
spinning until you kill it. Moreover, other socket connections, esp. newly
created, may starve because the illusionary activity of the broken one makes
the main loop skip them.

How to reproduce: kill a xenstore client (e.g. xenstore-ls) while it transmits
message body to xenstored.

Proposed fix: replace (bytes < 0) with (bytes <= 0).


-- 
Configure bugmail: http://bugzilla.xensource.com/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

_______________________________________________
Xen-bugs mailing list
Xen-bugs@lists.xensource.com
http://lists.xensource.com/xen-bugs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic