[elephant-devel] Next issue, this time with Postmodern backend

Leslie P. Polzer leslie.polzer at gmx.net
Wed Feb 27 13:36:46 UTC 2008


> Ah, you have alot of short-lived threads?  A quick look at pm-
> controller.lisp seems to indicate that pm-postmodern does not close
> connections when the thread closes.

Err... amazing that no one else experienced issues with this.
After all not only people using short-lived threads will have their
connections piling up. AFAICS the connections only get closed
on CLOSE-STORE, which is independent from thread running time.

Here's a remedy:

(defun pm-reap (sc)
  (maphash (lambda (thread bookkeeper)
             (let ((alive-p (sb-thread:thread-alive-p thread)))
               (unless alive-p
                 (cl-postgres:close-database (car bookkeeper))
                 (remhash thread (controller-db-table sc)))))
           (controller-db-table sc)))

I'm not sure how to integrate this best, though. The threading
stuff is not portable (do we have Bordeaux as dependency? Guess
not), so others here would have to provide that stuff for their
Lisps.

  Leslie




More information about the elephant-devel mailing list