Why Does This Controller Hang?

Given this controller:

RoR is not multithreaded so in your setup the call to /hang/m2 can't be
answered before the call to /hang/m2 returned which waits for /hang/ms
to return ...

Thanks for the reply. I realize that ROR is not multi-threaded and
that would explain why it hangs in the webrick case. I guess if
lighttpd is routing the second request to the same fastcgi instance,
that would explain why it hangs in that environment as well. But why
would lighttpd do that?

Anyway, this is more out of curiosity than anything else. I know in
general this type of thing won't work.

I don't know about lighttpd but a lot of load balancers seem to assume that the thing that they're balancing to is multithreaded, so that it doesn't matter if they queue more than one request to the same worker (as long as on average everyone gets the right amount of work. It may also be configured not to spawn more than a certain number of instances, it wouldn't surprise me if that number was 1 in dev mode.

Fred

I don't know about lighttpd but a lot of load balancers seem to
assume that the thing that they're balancing to is multithreaded, so
that it doesn't matter if they queue more than one request to the
same worker (as long as on average everyone gets the right amount of
work. It may also be configured not to spawn more than a certain
number of instances, it wouldn't surprise me if that number was 1 in
dev mode.

Ignore anything I said about lighttpd/fastcgi. It works ok in that
environment. The m2 request gets routed to another fastcgi process
and the whole thing works. It would probably hang/time out if all
fastcgi processes were doing the secondary request at the same time,
however.

Thanks for everybody's comments.