From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:40696) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TufDo-0001YF-SI for qemu-devel@nongnu.org; Mon, 14 Jan 2013 03:16:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TufDm-0003hE-Gb for qemu-devel@nongnu.org; Mon, 14 Jan 2013 03:16:44 -0500 Received: from mail-pa0-f54.google.com ([209.85.220.54]:60074) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TufDm-0003gs-A7 for qemu-devel@nongnu.org; Mon, 14 Jan 2013 03:16:42 -0500 Received: by mail-pa0-f54.google.com with SMTP id bi5so2101188pad.27 for ; Mon, 14 Jan 2013 00:16:41 -0800 (PST) Message-ID: <50F3BEE2.5090802@gmail.com> Date: Mon, 14 Jan 2013 16:16:34 +0800 From: Liu Yuan MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] 100% CPU when sockfd is half-closed and unexpected behavior for qemu_co_send() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Stefan Hajnoczi Hi List, This problem can be reproduced by: 1. start a sheepdog cluster and create a volume 'test'* 2. attach 'test' to a bootable image like $ qemu -hda image -drive if=virtio,file=sheepdog:test 3. pkill sheep # create a half-closed situation I have straced it that QEMU is busy doing nonsense read/write() after select() in os_host_main_loop_wait(). I have no knowledge of glib_select_xxx, so someone please help fix it. Another unexpected behavior is that qemu_co_send() will send data successfully for the half-closed situation, even the other end is completely down. I think the *expected* behavior is that we get notified by a HUP and close the affected sockfd, then qemu_co_send() will not send any data, then the caller of qemu_co_send() can handle error case. I don't know which one I should Cc, so I only include Stefan in. * You can easily start up a one node sheepdog cluster as following: $ git clone https://github.com/collie/sheepdog.git $ cd sheepdog $ apt-get install liburcu-dev $ ./autogen.sh; ./configure --disable-corosync;make #start up a one node sheep cluster $ mkdir store;./sheep/sheep store -c local $ collie/collie cluster format -c 1 #create a volume named test $ collie/collie vdi create test 1G Thanks, Yuan