From: Baker, Christopher <cbaker@fl...> - 2007-01-12 17:41:03
We have a server application originally written for Allegro that I've
ported to SBCL using ACL-COMPAT. We have an intermittent problem with
clients closing their connection. We have a thread which uses
UNIX-FAST-SELECT to see if there's any input available and creates new
threads to handle the input. When clients close the connection, it
detects this and closes the socket. Periodically, and only under a
load, this thread will get locked up trying to close the socket in
FINISH-OUTPUT, in FD-STREAM-MISC-ROUTINE:
((null (fd-stream-output-later fd-stream)))
so data got buffered up, but (presumably because the connection is
closed) it never gets sent. So I tried adding a call to CLEAR-OUTPUT
before closing the socket, but it didn't seem to help. Groveling
through the code it appears that CLEAR-OUTPUT isn't actually
implemented. I tried adding:
(setf (fd-stream-output-later fd-stream) nil))
to FD-STREAM-MISC-ROUTINE, right under the FINISH-OUTPUT clause, which
seems to solve the problem. Does this seem safe? Also, has anyone
had any similar problems, and how did you solve them?
Any and all feedback is appreciated.
Get latest updates about Open Source Projects, Conferences and News.