Hi!
I just realized that Hunchentoot in its current form has problems with file uploads if it's used behind mod_lisp. I could reproduce this with Apache 2 as well as Apache 1 and with LispWorks (but only on Linux, not on Windows) as well as with SBCL.
To try this yourself, start the demo that comes with Hunchentoot and upload a couple of pictures (I used JPEGs) in the file upload section. Click on the uploaded pictures and view them.
Symptoms that I see:
- files are sometimes uploaded only partly
- you see an Apache error message after an upload is finished (which usually means that mod_lisp can't talk to Lisp)
- server gets completely unresponsive after some time
It seems this is not deterministic, though. I've had situations where I uploaded the same picture a couple of times, and sometimes the whole file reached the server, sometimes only a part of it. One of the reasons for this that I could observe is that when rfc2388.lisp reads characters from the content stream, READ-CHAR sometimes returns NIL although the whole file hasn't been transferred yet (i.e. there should be more input available).
I'm writing this because I haven't found the reason for this behaviour yet and I'll probably be too busy in the next days to do something about it. Obviously, I'd be happy if someone else would debug this and find a solution. Meanwhile, maybe you shouldn't use Hunchentoot with mod_lisp for production servers. The stand-alone version doesn't seem to be affected, though.
Cheers, Edi.
On 10/28/06, Edi Weitz edi@agharta.de wrote:
Hi!
I just realized that Hunchentoot in its current form has problems with file uploads if it's used behind mod_lisp. I could reproduce this with Apache 2 as well as Apache 1 and with LispWorks (but only on Linux, not on Windows) as well as with SBCL.
Hi Edi,
Also busy here, but I have seen some odd recent behaviour with Hunchentoot and mod_lisp behind Apache 2. In keep-alive scenarios, the second request stalls for 60 seconds; I'm not sure whether the request is satisfied at that point, or whether the connection is simply closed. Perhaps this problem shares a common root with the upload problem?
As a workaround, I've been setting a Connection: close header on all requests, hoping to get the problem solved later on. It does the trick, though of course it's not a long-term solution. In case anyone needs it, here's my workaround:
(defun mod-lisp-close-hack (req) (prog1 nil (setf (slot-value req 'headers-in) (cons '(:connection . "close") (remove :connection (slot-value req 'headers-in) :key #'car)))))
(setq *dispatch-table* (cons #'mod-lisp-close-hack *dispatch-table*))
I'll try to debug this and the upload issue if I can.
Graham
On Sun, 29 Oct 2006 12:43:01 -0500, "Graham Fawcett" graham.fawcett@gmail.com wrote:
Also busy here, but I have seen some odd recent behaviour with Hunchentoot and mod_lisp behind Apache 2. In keep-alive scenarios, the second request stalls for 60 seconds; I'm not sure whether the request is satisfied at that point, or whether the connection is simply closed. Perhaps this problem shares a common root with the upload problem?
I think so. Somehow it looks as if the connection between mod_lisp and Lisp is closed prematurely. This obviously happened when I ported TBNL to Hunchentoot as it wasn't an issue before. My guess is that in mod_lisp mode Hunchentoot fiddles with headers it should ignore.
I'll try to debug this and the upload issue if I can.
That would be nice!
On Sun, 29 Oct 2006 03:07:26 +0100, Edi Weitz edi@agharta.de wrote:
I just realized that Hunchentoot in its current form has problems with file uploads if it's used behind mod_lisp.
I think I've fixed this in 0.4.8 now. At least I found something in START-OUTPUT which was obviously wrong and a result of my porting and re-factoring Hunchentoot/TBNL too hastily.
Cheers, Edi.
On 11/5/06, Edi Weitz edi@agharta.de wrote:
On Sun, 29 Oct 2006 03:07:26 +0100, Edi Weitz edi@agharta.de wrote:
I just realized that Hunchentoot in its current form has problems with file uploads if it's used behind mod_lisp.
I think I've fixed this in 0.4.8 now. At least I found something in START-OUTPUT which was obviously wrong and a result of my porting and re-factoring Hunchentoot/TBNL too hastily.
Version 0.4.8 also appears to fix the mod_lisp / keep-alive problem I reported on Oct 29. Thanks!
Graham