WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-bugs

[Xen-bugs] [Bug 968] New: xenstored spinning after EOF

To: xen-bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-bugs] [Bug 968] New: xenstored spinning after EOF
From: bugzilla-daemon@xxxxxxxxxxxxxxxxxxx
Date: Wed, 18 Apr 2007 11:25:02 -0700
Delivery-date: Wed, 18 Apr 2007 11:26:04 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-bugs-request@lists.xensource.com?subject=help>
List-id: Xen Bugzilla <xen-bugs.lists.xensource.com>
List-post: <mailto:xen-bugs@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-bugs>, <mailto:xen-bugs-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-bugs>, <mailto:xen-bugs-request@lists.xensource.com?subject=unsubscribe>
Reply-to: bugs@xxxxxxxxxxxxxxxxxx
Sender: xen-bugs-bounces@xxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxxxxx
        ReportedBy: peak@xxxxxxxxxxxxxxxxxxxxxx


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@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-bugs

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-bugs] [Bug 968] New: xenstored spinning after EOF, bugzilla-daemon <=