Gabor Melis wrote:
> On sbcl 0.8.14 I have a strange problem when using postgresql and
> aserve: if I connect to a database then sbcl sometimes gets killed
> when receiving a lot of http requests. I can reproduce this problem
> by load this file and reloading http://localhost:2001/ a lot of
> times. Holding f5 down in konqueror will do.
Thanks for the test case. I've also been able to reproduce this
using apache's ab program, such as
ab -n 6 -c 3 http://localhost:2001/
> Of course I'm not really sure who is the culprit. It suspect it clsql's
> postgresql connector, if postgresql-socket is used then the problem goes
I believe the problem may be an interaction with SIGPIPE handlers
between SBCL and libpq. I've cc'd this message to sbcl-devel to see if
any SBCL developers/users have some insight into this possibility.
Some data points:
1) Testing your example program with mysql and
postgresql-socket backends, a SIGPIPE error is caught by SBCL,
presumably due to the a incoming connection being closed by waiting
to for page request to be serviced.
2) When testing with SBCL and postgresql backend, at the time in the
test sequence that a SIGPIPE message would be printed using mysql
and postgresql-socket backends, SBCL is killed rather than
displaying the SIGPIPE message.
3) In http://linux.com.hk/docs/postgresql/libpq-threading.html,
the documentation states that libpq installs its own SIGPIPE
handler. I believe the SIGPIPE is perhaps being caught by libpq which
I'm not sure how to work-around this or indeed to prove my suspicion
is correct. One thing you may wish to look at whether sigpipe messages
can be turned off in sb-bsd-sockets, perhaps using
sockint::MSG-NOSIGNAL. While turning off sigpipe messages may fix SBCL
being killed, it may affect the function http-worker-thread in
paserve's main.cl which apparently handles sigpipe errors detected
with the function connection-reset-error.
I've attached a slightly modified version of your test case to this
message in case someone wants to look at this interaction.
Thanks again for the interesting report and the test case.
From: Kevin Rosenberg <kevin@ro...> - 2004-09-28 06:59:23
Rudi Schlatte wrote:
> IIRC, sigpipe is only "handled" specially by aserve so that it can be
> ignored in the logs, because it happens frequently during normal
> operation. Turning sigpipe off should have no ill effects.
That's how it appeared to me as well. Thanks for the confirmation.