On 10/29/07, Attila Lendvai <attila.lendvai@...> wrote:
> recently i've been experiencing threads hanging in CL:CLOSE called on
> a socket stream. this rarely happens, but often enough to hang 30-40
> threads a day and finally kill sbcl with out of memory error unless i
> connect with slime and manually unwind the stalled threads.
I have not looked at this in detail, but my immediate guess is that
you are stuck with a slow or dead client(s): there is pending output
on the stream, and the OS buffers are full -- if the client is simply
gone, the flush implicit in CLOSE hangs.
;; This at the end of a WITH-STREAMLIKE-THING or whatever has the
;; CLOSE in its cleanups. (And assuming that the cleanup CLOSE does
;; TRT with unwinds -- uses :ABORT T, that is.)
(sb-sys:with-deadline (:seconds <good-for-you>)
should be a fairly reasonable way to do this while waiting for
a stream API that has timeout arguments.