hunchentoot stress test fails in interesting ways
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Invalid
|
High
|
Unassigned |
Bug Description
The following test-case provokes all sorts of badness. Some of it may originate in Hunchentoot
or various libraries, but it should none the less be diagnoses, as odds good are that something goes
wrong on the SBCL side of the fence as well.
(require :asdf)
(require :drakma)
(require :hunchentoot)
(defun stress-threads ()
(declare (optimize (speed 3)))
(hunchentoot:
(let ((dribble-lock (sb-thread:
(loop for i from 2 upto 4
collect (let ((n (character (princ-to-string i)))
Changed in sbcl: | |
importance: | Undecided → High |
status: | New → Confirmed |
Changed in sbcl: | |
status: | Confirmed → Fix Released |
Recent hunchentoot is started slightly differently and I got a lot of "connection reset by peer" simple- stream- errors so I had to handle that condition:
(defun stress-threads () start (make-instance 'hunchentoot: acceptor :port 4242)) make-mutex :name "dribble")))
(url (format nil "http:// localhost: 4242")))
( sb-thread: make-thread
(lambda ()
(dotimes (i 10000000)
(when (zerop (mod i 50))
( sb-thread: with-mutex (dribble-lock)
(write- char n *terminal-io*)
(force- output *terminal-io*)))
(handler- case
(drakma: http-request url)
( sb-int: simple- stream- error ()
t)
( end-of- file ()
t)
( sb-bsd- sockets: socket- error ()
t))))
:name n)))))
(declare (optimize (speed 3)))
(hunchentoot:
(let ((dribble-lock (sb-thread:
(loop for i from 2 upto 4
collect (let ((n (character (princ-to-string i)))
On a two cpu x86/linux box I left it running on sbcl 1.0.28 for a couple of hours without experiencing any sort of badness. Versions of major components:
hunchentoot: 1.0.0
drakma: 1.0.0
usocket: 0.4.1
flexi-streams: 0.9.1
chunga: 0.2.3
cl+ssl: 2008-11-04