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-devel

[Xen-devel] [PATCH] Make XenD SEXPR HTTP/Unix server threaded

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] Make XenD SEXPR HTTP/Unix server threaded
From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
Date: Fri, 6 Oct 2006 01:01:15 +0100
Delivery-date: Thu, 05 Oct 2006 17:01:48 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Reply-to: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.1i
I've spent the best part of the afternoon trying to figure out why the
virt-manager application was completely locking up while creating new
domains. The actual domain creation was being done in a background thread
to avoid blocking the main UI refresh thread, but even so it still locks
up. After a little while I discovered that both threads were blocked waiting
for data to come back from XenD, one in the wait_for_devices call, the 
other in a simple /xend/node GET. 

After much code inspection I eventually discovered that the HttpServer class
in xen.web.httpserver  serializes all pocessing of incoming HTTP requests.
Since wait_for_devices was busy waiting for a domain to come up, the
other /xend/node GET was being blocked & hence blocking the whole client
application.  Clearly this is a sub-optimal scenario because wait_for_devices
can take a *very* long time indeed (30 seconds in my case due to network
device setup failing).

I did a very trivial hack to HttpServer class to make it spawn a new thread
for every incoming request which ensures all client requests are fully
parallelized.  Before building this into the Fedora RPMs, I'm just wondering
whether there was any special reason why for HttpServer being single threaded
in the first place ?  I thought perhaps some synchronization / race
conditions perhaps, but given that the alternate XML-RPC server is fully
multi-threaded I figure this is unlikely.

I'm attaching the patch I knocked up - if anyone knows of a reason why this
would cause problems, please shout :-)

  Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>

Regards,
Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

Attachment: xen-sexpr-threaded.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] Make XenD SEXPR HTTP/Unix server threaded, Daniel P. Berrange <=