Received: by 10.66.79.6 with SMTP id f6mr4899998pax.3.1350476809064; Wed, 17 Oct 2012 05:26:49 -0700 (PDT) X-BeenThere: cherrypy-users@googlegroups.com Received: by 10.68.189.162 with SMTP id gj2ls26520860pbc.6.gmail; Wed, 17 Oct 2012 05:26:46 -0700 (PDT) Received: by 10.66.89.135 with SMTP id bo7mr4913346pab.39.1350476806637; Wed, 17 Oct 2012 05:26:46 -0700 (PDT) Received: by 10.66.89.135 with SMTP id bo7mr4913345pab.39.1350476806625; Wed, 17 Oct 2012 05:26:46 -0700 (PDT) Return-Path: Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by gmr-mx.google.com with ESMTPS id js4si970250pbb.2.2012.10.17.05.26.45 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 17 Oct 2012 05:26:45 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.45 is neither permitted nor denied by best guess record for domain of s...@defuze.org) client-ip=209.85.220.45; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 209.85.220.45 is neither permitted nor denied by best guess record for domain of s...@defuze.org) smtp.mail...@defuze.org Received: by mail-pa0-f45.google.com with SMTP id fb10so7125928pad.32 for ; Wed, 17 Oct 2012 05:26:45 -0700 (PDT) d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:date :message-id:subject:from:to:content-type:x-gm-message-state; bh=wzlVBHhKjnTlgVVo41REmc1xEWdYuYgIH4ngp2IHJFU=; b=iTcvu+Wx4/OOQN7F+cAe0p9zonTn57SU/Bs+f1iVrdJdI2mkIyzov4REcXOeuDAymI KwLkJu3BAcufHsJ8oNWVR7NwkzyaFz1rqe3Dzu0BiXBWoHtyzVZNYJrqLciOSYCjT0Wh jJXdwjTK7Xg21WP4yaeZraMoYLI2VRgpXSmAsAV5WNRZpMyD2Q08O5h1JKeCRPKYmWzj Vh94t79R0If915O3H/4VyEzd8LU5BaXdwly/GKULNX07crEjiLBIcnL4fmTvl7XWtdQV YfRU0KKIQorZAg1yhcGEkPTmQ94obsqdSvhVWeEikpObwAdRvmUtgcuZ3aB6nCHnsMhZ phCA== MIME-Version: 1.0 Received: by 10.68.217.201 with SMTP id pa9mr55952251pbc.45.1350476805613; Wed, 17 Oct 2012 05:26:45 -0700 (PDT) Received: by 10.68.148.135 with HTTP; Wed, 17 Oct 2012 05:26:45 -0700 (PDT) X-Originating-IP: [217.109.159.101] In-Reply-To: <5383db48-c2c8-4d4f-ab16-f99ff9a92262@googlegroups.com> References: <5383db48-c2c8-4d4f-ab16-f99ff9a92262@googlegroups.com> Date: Wed, 17 Oct 2012 14:26:45 +0200 Message-ID: Subject: Re: [cherrypy-users] Bus error, possibly from recursive call From: Sylvain Hellegouarch To: cherrypy-users@googlegroups.com Content-Type: multipart/alternative; boundary=047d7b2edb0946a8b904cc4062b3 X-Gm-Message-State: ALoCoQkB56Tg3s0Uvu1QBF21DCQk0AF7G2dJy2z0eEQqHf9fk16xwtGnxo+L4BZPjurAUs3VYtIj --047d7b2edb0946a8b904cc4062b3 Content-Type: text/plain; charset=ISO-8859-1 Hi Eddie, On Wed, Oct 17, 2012 at 2:19 PM, Eddie Sholl wrote: > Hi all, > > I'm quite new to cherrypy, I've been playing around with it over the last > few weeks and enjoying the simple and minimal approach taken with the > framework. Ive been using it for a small project of mine, which is > primarily for running a turn based strategy game engine, and an AI for > playing that game. > > I've run into a problem that Im having trouble investigating further. I'm > basically just getting a 'Bus error' message in my console output, and > everything dies at that point. The code that runs to produce the failure is > a recursive method, and obviously thats not ideal to be running during a > request. But my profiling and tracing suggests its only being called ~100 > times before cherrypy falls over, and its only to a max depth of 2. > I've never come across a "Bus error" issue like you've had. Could you provide more context? What is your app, hence the bus, doing at the point where it dies? > > So ive got a couple of questions that can help me deal with the issue. > First of all, I was looking for a nice example of async request handling. > The best hints so far are either the BackgroundTask or Monitor documented > at > http://docs.cherrypy.org/stable/refman/process/plugins/index.html#monitors(i'd really like to see an example to get my head around how to use these), > or the wiki article http://tools.cherrypy.org/wiki/BackgroundTaskQueue. > Is this how I should proceed to shift the load of my game AI out of a > straight synchronous request handler? > > If you don't mind threads and having everything within your main Python process, those are great. If you want something more distributed you could look at writing a plugin interfacing celery [1] or something similar. You could get some inspiration from some recipes I wrote [2]. [1] http://celeryproject.org/ [2] https://bitbucket.org/Lawouach/cherrypy-recipes/src/c899e1b914171d3c3d9f3b80bb22f2e9e41992b6/web/caching/memcached_caching?at=default -- - Sylvain http://www.defuze.org http://twitter.com/lawouach --047d7b2edb0946a8b904cc4062b3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Eddie,

On Wed, Oct 17, 2012 at 2:19 PM= , Eddie Sholl <eddie.sh...@gmail.com> wrote:
Hi all,

I'm quite new to cherrypy, I've been pla= ying around with it over the last few weeks and enjoying the simple and min= imal approach taken with the framework. Ive been using it for a small proje= ct of mine, which is primarily for running a turn based strategy game engin= e, and an AI for playing that game.

I've run into a problem that Im having trouble inve= stigating further. I'm basically just getting a 'Bus error' mes= sage in my console output, and everything dies at that point. The code that= runs to produce the failure is a recursive method, and obviously thats not= ideal to be running during a request. But my profiling and tracing suggest= s its only being called ~100 times before cherrypy falls over, and its only= to a max depth of 2.


I've never come across = a "Bus error" issue like you've had. Could you provide more c= ontext? What is your app, hence the bus, doing at the point where it dies?<= /div>

=A0

=
So ive got a couple of questions that can help me deal with the issue.= First of all, I was looking for a nice example of async request handling. = The best hints so far are either the BackgroundTask or Monitor documented a= t=A0http://docs.cherrypy.org/stable/refman/pr= ocess/plugins/index.html#monitors (i'd really like to see an exampl= e to get my head around how to use these), or the wiki article=A0http= ://tools.cherrypy.org/wiki/BackgroundTaskQueue. Is this how I should pr= oceed to shift the load of my game AI out of a straight synchronous request= handler?


If you don't mind threa= ds and having everything within your main Python process, those are great. = If you want something more distributed you could look at writing a plugin i= nterfacing celery [1] or something similar.

You could get some inspiration from some recipes I wrot= e [2].


--
- Sylvain
= http://www.defuze.org
http:/= /twitter.com/lawouach
--047d7b2edb0946a8b904cc4062b3--