From: flaunt
Subject: mod_lisp
Date: 
Message-ID: <yWxva.847912$S_4.864058@rwcrnsc53>
I'm using mod_lisp (from www.fractalconcept.com) with apache 1.3.x and
freebsd.  I'm having an issue where the pages that I'm serving up sometimes
load and sometimes don't load.  If a page doesn't load and hit the refresh
button on the browser it usually comes up at that point.  Has anyone else
using mod_lisp had this problem?  Any ideas where to start to debug this
problem?

From: Edi Weitz
Subject: Re: mod_lisp
Date: 
Message-ID: <87n0htjkzp.fsf@bird.agharta.de>
"flaunt" <············@yahoo.com> writes:

> I'm using mod_lisp (from www.fractalconcept.com) with apache 1.3.x
> and freebsd.  I'm having an issue where the pages that I'm serving
> up sometimes load and sometimes don't load.  If a page doesn't load
> and hit the refresh button on the browser it usually comes up at
> that point.  Has anyone else using mod_lisp had this problem?  Any
> ideas where to start to debug this problem?

I had a similar problem which was due to Apache not reading all data
from the socket (between Apache and mod_lisp) in some cases - like
when the browser aborted the request. This was fixed in 2.3 so you
should first make sure that you have at least this version of
mod_lisp.

I suspect a similar thing may happen in recent mod_lisp versions if
the browsers sends a HEAD request (see the code for the r->header_only
case in mod_lisp). You might want to check this with a tool like
Ethereal (or "Live HTTP Headers" in case the problem can be reproduced
with Mozilla).

Another way to debug this would be _not_ to send Content-length
headers from your Lisp program even if you know the length of the
body. This should result in mod_lisp falling back to its "old"
behaviour. Check if you still see the same errors in this case.

HTH,
Edi.
From: flaunt
Subject: Re: mod_lisp
Date: 
Message-ID: <wKFva.851086$S_4.873439@rwcrnsc53>
Thanks for the suggestions.  I downloaded ethereal and did a capture when
the page wasn't coming up, and here's what I got.

GET /app/test HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/x-shockwave-flash, application/msword, */*
Referer: http://192.168.0.5/
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR
1.0.3705)
Host: 192.168.0.5
Connection: Keep-Alive

HTTP/1.1 200 OK
Date: Mon, 12 May 2003 02:53:28 GMT
Server: Apache/1.3.27 (Unix) mod_lisp/2.32
Keep-Alive: timeout=15, max=99
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/plain

0


The lack of a "Content-Length" header in the response bothers me.  I suppose
the "0" at the end represents lack of data, but I don't know.  Killing and
restarting the Lisp process didn't help anything.  Stopping and starting
apache, however, did.  The new response was:

HTTP/1.1 200 OK
Date: Mon, 12 May 2003 03:20:27 GMT
Server: Apache/1.3.27 (Unix) mod_lisp/2.32
Content-Length: 369
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/html

(followed by the html data)

The big difference here is the presence of the "Content-Length" header, and
the "Content-Type" header changed from "text/plain" to "text/html".  Notice
that I have mod_lisp 2.32, which is the latest release according to Marc
Battyani.  I guess this mainly points to a problem with the "Content-Length"
header.  Does it make sense that this is most likely a problem somewhere in
the mod_lisp code?  If so I'll try to do some hacking of it.  I suspect it
is in mod_lisp after visiting the Change Log on the fractalconcept site and
noticing this entry:

"15-01-2003
Version 2.31
Put back the mode where the lisp process sends data without knowing its
length. That data is sent back to the browser without waiting for the full
request to be processed."

Perhaps this is some place to start.  More recommendations are welcome.

Thanks again.







"Edi Weitz" <···@agharta.de> wrote in message
···················@bird.agharta.de...
> "flaunt" <············@yahoo.com> writes:
>
> > I'm using mod_lisp (from www.fractalconcept.com) with apache 1.3.x
> > and freebsd.  I'm having an issue where the pages that I'm serving
> > up sometimes load and sometimes don't load.  If a page doesn't load
> > and hit the refresh button on the browser it usually comes up at
> > that point.  Has anyone else using mod_lisp had this problem?  Any
> > ideas where to start to debug this problem?
>
> I had a similar problem which was due to Apache not reading all data
> from the socket (between Apache and mod_lisp) in some cases - like
> when the browser aborted the request. This was fixed in 2.3 so you
> should first make sure that you have at least this version of
> mod_lisp.
>
> I suspect a similar thing may happen in recent mod_lisp versions if
> the browsers sends a HEAD request (see the code for the r->header_only
> case in mod_lisp). You might want to check this with a tool like
> Ethereal (or "Live HTTP Headers" in case the problem can be reproduced
> with Mozilla).
>
> Another way to debug this would be _not_ to send Content-length
> headers from your Lisp program even if you know the length of the
> body. This should result in mod_lisp falling back to its "old"
> behaviour. Check if you still see the same errors in this case.
>
> HTH,
> Edi.
From: Marc Battyani
Subject: Re: mod_lisp
Date: 
Message-ID: <b9ng7e$1l3@library2.airnews.net>
"flaunt" <············@yahoo.com> wrote
> Thanks for the suggestions.  I downloaded ethereal and did a capture when
> the page wasn't coming up, and here's what I got.

[...]
> HTTP/1.1 200 OK
> Date: Mon, 12 May 2003 02:53:28 GMT
> Server: Apache/1.3.27 (Unix) mod_lisp/2.32
> Keep-Alive: timeout=15, max=99
> Connection: Keep-Alive
> Transfer-Encoding: chunked
> Content-Type: text/plain
>
> 0
>
> The lack of a "Content-Length" header in the response bothers me.  I
suppose
> the "0" at the end represents lack of data, but I don't know.

There is also the lack of Context-Type.

> Killing and
> restarting the Lisp process didn't help anything.  Stopping and starting
> apache, however, did.  The new response was:
>
> HTTP/1.1 200 OK
> Date: Mon, 12 May 2003 03:20:27 GMT
> Server: Apache/1.3.27 (Unix) mod_lisp/2.32
> Content-Length: 369
> Keep-Alive: timeout=15, max=100
> Connection: Keep-Alive
> Content-Type: text/html
>
> (followed by the html data)
>
> The big difference here is the presence of the "Content-Length" header, and
> the "Content-Type" header changed from "text/plain" to "text/html".  Notice
> that I have mod_lisp 2.32, which is the latest release according to Marc
> Battyani.  I guess this mainly points to a problem with the
"Content-Length"
> header.  Does it make sense that this is most likely a problem somewhere in
> the mod_lisp code?  If so I'll try to do some hacking of it.  I suspect it
> is in mod_lisp after visiting the Change Log on the fractalconcept site and
> noticing this entry:
>
> "15-01-2003
> Version 2.31
> Put back the mode where the lisp process sends data without knowing its
> length. That data is sent back to the browser without waiting for the full
> request to be processed."

I should not be a pb, it's just that in 2.3 mod_lisp was forced to read
content-length bytes for the lisp process before going on. So this didn't
work if content-length was not supplied. mod_lisp 2.31 corrected this.

> Perhaps this is some place to start.  More recommendations are welcome.

What do you do on the Lisp side ?
Are you sending a content-length or not ?
Are you sure of its value ? (Do you send exactly the number of bytes required
?)
What Lisp are you using ?

As Edi told you, you should try without sending a value for Content-Length
and closing the socket at the end of the data. In that case, mod_lisp will
close the socket and create a new one for each request.

Marc
From: flaunt
Subject: Re: mod_lisp
Date: 
Message-ID: <80_wa.899140$S_4.916038@rwcrnsc53>
> > Perhaps this is some place to start.  More recommendations are welcome.
>
> What do you do on the Lisp side ?
> Are you sending a content-length or not ?
> Are you sure of its value ? (Do you send exactly the number of bytes
required
> ?)
> What Lisp are you using ?
>
> As Edi told you, you should try without sending a value for Content-Length
> and closing the socket at the end of the data. In that case, mod_lisp will
> close the socket and create a new one for each request.
>
> Marc
>
>



Well right now I'm just trying to get a feel for how things work, so on the
Lisp side I'm pretty much just serving up some HTML code.  I use Kevin
Rosenberg's LML for this purpose.  I started with some sample code that came
with CMUCL (which is the Lisp i'm using), and that code was based on your
mod-lisp.lisp code.  Could CMUCL be the problem?  I could try CLISP instead
I suppose.  The code was sending a value for Content-Length, but I took that
line out and started closing the socket at the end of the data, as a test.
That seems to help a lot, but it doesn't seem to entirely take care of the
problem.  What I mean is that I don't ever get a completely blank page, but
the main page is a frameset and sometimes one of the frames doesn't load.  I
should probably either try CLISP or maybe starting from scratch so that I
have a better understanding of how the modlisp-cmucl-apache code works.
Which do you think would be the better route to go?  Thanks for your help.
From: Adam Warner
Subject: Re: mod_lisp
Date: 
Message-ID: <pan.2003.05.16.05.19.10.20973@consulting.net.nz>
Hi flaunt,

> Well right now I'm just trying to get a feel for how things work, so on
> the Lisp side I'm pretty much just serving up some HTML code.  I use
> Kevin Rosenberg's LML for this purpose.  I started with some sample code
> that came with CMUCL (which is the Lisp i'm using), and that code was
> based on your mod-lisp.lisp code.  Could CMUCL be the problem?  I could
> try CLISP instead I suppose.

It could be the problem. Here's an idea for another approach: As I didn't
have the skills to port mod_lisp to Apache 2 I simply went with a plain
CGI connection to CLISP (which incidentally also talks to CMUCL). It's a
moderately efficient approach and one naturally gets some of the benefits
of multithreading by running separate instances of CLISP (but in a very
robust manner: program code can have a bug or CLISP can crash and the
website continues as usual with other connections). CLISP has a relatively
small footprint and very fast loading times and with enough memory thrown
at the server it could cope with high simultaneous loads, especially if
one uses Apache to serve all static content.

Regards,
Adam
From: Daniel Barlow
Subject: Re: mod_lisp
Date: 
Message-ID: <874r404c82.fsf@noetbook.telent.net>
"flaunt" <············@yahoo.com> writes:

> HTTP/1.1 200 OK
> Date: Mon, 12 May 2003 02:53:28 GMT
> Server: Apache/1.3.27 (Unix) mod_lisp/2.32
> Keep-Alive: timeout=15, max=99
> Connection: Keep-Alive
> Transfer-Encoding: chunked
> Content-Type: text/plain
>
> 0

> The lack of a "Content-Length" header in the response bothers me.  I suppose
> the "0" at the end represents lack of data, but I don't know.  Killing and
> restarting the Lisp process didn't help anything.  Stopping and starting
> apache, however, did.  The new response was:

Note the "chunked" Transfer-Encoding header.  HTTP/1.1 says, IIRC,
that on a persistent connection you must send either a Content-Length
header or use chunked encoding, so that the client knows when to stop
reading.  The body of a chunked response is a series of chunks of data,
each preceded by the length in octets of that chunk in decimal ascii, 
and a newline.  I haven't checked the RFC recently, but if my memory
is correct what you have here is a perfectly correct HTTP/1.1 response 
for an empty element body

I'm not familiar with mod_lisp, but my guess would be that there's
something wrong with the communication between mod_lisp and the Lisp
process itself that's causing mod_lisp to stop after reading zero
bytes.


-dan

-- 

   http://www.cliki.net/ - Link farm for free CL-on-Unix resources 
From: Eduardo Muñoz
Subject: Re: mod_lisp
Date: 
Message-ID: <uhe819pvy.fsf@terra.es>
* "flaunt" <············@yahoo.com>
| I'm using mod_lisp (from www.fractalconcept.com) with apache 1.3.x and
| freebsd.  I'm having an issue where the pages that I'm serving up sometimes
| load and sometimes don't load.  If a page doesn't load and hit the refresh
| button on the browser it usually comes up at that point.  Has anyone else
| using mod_lisp had this problem?  Any ideas where to start to debug this
| problem?

Something similar has happened to me sometimes while playing
with my server but I think that the one at fault is CMUCL. I
think it gets confused about what goes where while running
multiple processes. The solution is (for me) to kill all the
processes but the REPL and recompile & reload the lisp files
that define pages.

BTW, if you are playing with web pages try Tim Bradshaw's
htout (http://www.tfeb.org/lisp/hax.html#HTOUT)

-- 
Eduardo Mu�oz          | (prog () 10 (print "Hello world!")
http://213.97.131.125/ |          20 (go 10))