[racket] Continue: reentrant promises and custodian suicides

From: Ryan Culpepper (ryan at cs.utah.edu)
Date: Thu Jul 14 11:17:39 EDT 2011

On 07/14/2011 08:31 AM, Dominic Pearson wrote:
> Hello folks!
>
> I have been writing an application in Racket using Continue, and have
> been stress testing it in the early development phase using `siege', to
> see if it is suitable for future heavy lifting.
>
> Under high load I get some very odd messages. Requests sometimes fail
> with
>
> 	force: reentrant promise fun-p

Those look like they're from ryanc/db. I suspect you see them at the 
very beginning, before the "lazy requires" (which are implemented with 
promises) have been forced.

I'll replace the promises with something that avoids the reentrant 
check, since it's unnecessary for my purposes. Meanwhile, a temporary 
workaround is to use the "specific" modules documented in 2.3 of 
http://planet.racket-lang.org/package-source/ryanc/db.plt/1/3/planet-docs/db/connect.html; 
eg replace

   (require (planet ryanc/db:1:3))

with

   (require (planet ryanc/db:1:3/base)
            (planet ryanc/db:1:3/postgresql))

> and sometimes Racket just stalls and refuses to accept any additional
> requests with the message
>
> 	thread: the custodian has been shut down: #<custodian>

I'm not sure about this one. Do you get a context/backtrace with this error?

Ryan


Posted on the users mailing list.