Barry Rowlingson wrote:
> On Sun, May 24, 2009 at 7:57 PM, Toby HOCKING <toby.hock...@etu.upmc.fr> 
> wrote:
>> Yes this is a bizarre error that I had been getting. It was difficult
>> to track down
>> exactly where the bug came from, but it was somehow related to the C
>> stack limit size,
>> which was evidently too small and causing the R process to crash ...
>> only when used in
>> conjunction with RPy and Django (bizarre I know). The workaround that
>> I came up with was
>> to use the command "ulimit -s unlimited" in the parent shell of every
>> python django
>> process. Hope this helps.
> 
>  I hit this problem at the weekend. It seemed to occur only when
> importing rpy from a django view function. So I tried importing rpy
> from settings.py, so it happens once at the start of the django run.
> 
>  My settings.py starts like this:
> 
> from rtest.rshim import myR
> 
>  Because for some reason I factored out the rpy import into rshim.py
> within an app. It looks like this:
> 
> from rpy import r
> myR = r
> 
>  and then view code that needs rpy does this:
> 
> from project.rtest.rshim import myR as r
> 
>  I'm not sure if that level of complexity is strictly necessary. I
> think the root cause is starting up R from a view which maybe is
> running in some odd thread context.

If threads are involved, I think that rpy will be particularly brittle, 
with stack errors such as the ones you observed happening. rpy2 should 
not have the stack issue.

>  Maybe this works for you too. I'm on rpy 1.x and R 2.9.x and
> django-latest-stable using django's built in server.
> 
>  I'm not sure what happens if you get multiple requests, but then
> django's test server (I think) blocks on each request.

In theory, the GIL will be acquired when entering C-level calls and only
be released upon exiting. That would make multiple requests queue up to
have their R code executed.

> Running from
> apache with mod-python? 

Most likely, and C stack errors have been reported in that context have 
be reported on that list, I think.

> I have no idea... I'd do some serious testing
> before making any kind of production system with this.
>
> Or possible
> move the R business onto a separate server with Rserver.

Definitely an option if objects exchanged both ways (to R and from R) 
are of "reasonable" size



L.




> Barry
> 
> ------------------------------------------------------------------------------
> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
> is a gathering of tech-side developers & brand creativity professionals. Meet
> the minds behind Google Creative Lab, Visual Complexity, Processing, & 
> iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
> Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
> _______________________________________________
> rpy-list mailing list
> rpy-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rpy-list



------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to