fukamachi / clack

Web server abstraction layer for Common Lisp
MIT License
1.05k stars 86 forks source link

clack:stop doesn't work with cl-dbi in my environment #118

Open hipeta opened 9 years ago

hipeta commented 9 years ago

Hi, I have a problem with using clack and integral. In my environment (Ubuntu 12.04 64-bit, sbcl 1.2.13, mysql 5.5.43), clack:stop doesn't work with integral. I have found that it occurs after executing query via cl-dbi. This is the code.

(ql:quickload '(:clack :cl-dbi))

(dbi:with-connection (conn :mysql :database-name *** :username *** :password ***)
  (dbi:fetch (dbi:execute (dbi:prepare conn "show tables;"))))

(clack:clackup (lambda (env) `(200 (:content-type "text/plain") ("hello"))))

(clack:stop *)

After this, localhost:5000 still returns "hello". (But ccl 1.10 x86-64 stops the server correctly...) Though it is perhaps caused by my environment, does anyone have same problem?

rudolph-miller commented 9 years ago

I could reproduce the issue. ;(

fukamachi commented 9 years ago

Actually, I found the same problem when starting it with Shelly like a year ago. It may be a problem in cl-mysql with thread-enabled SBCL, but I'm still not sure why.

On Mon, Jul 6, 2015 at 11:10 AM, Rudolph Miller notifications@github.com wrote:

I could reproduce the issue. ;(

— Reply to this email directly or view it on GitHub https://github.com/fukamachi/clack/issues/118#issuecomment-118692004.

rudolph-miller commented 9 years ago

Okay, it seems to be the issue of cl-mysql

(ql:quickload '(:cl-mysql ))
(let ((thread (sb-thread:make-thread (lambda () (loop)))))
  (print (sb-thread:thread-alive-p thread))
  (sb-thread:destroy-thread thread)
  (sleep 1)
  (print (sb-thread:thread-alive-p thread)))
;; T
;; NIL

(cl-mysql:connect :database "test" :user "root")

(let ((thread (sb-thread:make-thread (lambda () (loop)))))
  (print (sb-thread:thread-alive-p thread))
  (sb-thread:destroy-thread thread)
  (sleep 1)
  (print (sb-thread:thread-alive-p thread)))
;; T
;; T

.

hipeta commented 9 years ago

I understand. I use ccl for now and wait for cl-mysql fixed. Thanks!

rudolph-miller commented 9 years ago

:)