From tom.weissmann at gmail.com Fri Jun 26 09:52:59 2009 From: tom.weissmann at gmail.com (Tom Weissmann) Date: Fri, 26 Jun 2009 11:52:59 +0200 Subject: [kpax-devel] Error stopping server with mod-lisp and SBCL Message-ID: <6b1460640906260252j27bf7c15jee0584da9d255eef@mail.gmail.com> Hi, Whilst experimenting with the KPAX examples and sbcl I experienced errors trying to stop the server: (stop-kpax) produces the error: The value (("mod-lisp server port 2001" # #)) is not of type SB-THREAD:THREAD. Looking into it can't understand how would ever work: - The server's applicable startup method sets it server-process slot to the result of calling s-sysdeps:start-standard-server. - With sbcl, s-sysdeps:start-standard-server returns the result of (push (list name socket (sb-sys:add-fd-handler (sb-bsd-sockets:socket-file-descriptor socket) :input handler-fn)) *server-processes*) ... this looks highly suspect - The server's applicable shutdown method tries to call s-sysdeps:kill-process on this. - With sbcl, s-sysdeps:kill-process uses sb-thread:terminate-thread, which doesn't expect a list of lists. --- The following ugly hack in mod-lisp.lisp fixes the immediate problem but not much else: (defmethod shutdown ((web-app-server mod-lisp-server) &optional options) (destructuring-bind (&key (graceful t) &allow-other-keys) options (declare (ignore graceful)) (with-slots (server-process client-processes) web-app-server (dolist (process client-processes) ;; these should be removed when unwinding (s-sysdeps:kill-process process)) (setf client-processes nil) (when server-process #+sb-thread (dolist (proc-info server-process) (s-sysdeps::stop-server (first proc-info))) #-sb-thread (s-sysdeps:kill-process server-process) (setf server-process nil))) (call-next-method)) web-app-server) Regards, Tom SW