[Openmcl-devel] CCL 1.2 and portable allegroserve - can't restart server

JTK jetmonk at gmail.com
Wed Sep 17 21:52:17 UTC 2008


Some more progress on aserve restarts failing.

The glitch that prevents aserve from restarting after a shutdown seems to be
that worker threads waiting on a semaphore  are killed with process-kill.
Somehow, the semaphore and the kill don't mix.

I changed it so that, at shutdown, waiting threads are not killed, but
rather they are sent the wake-up semaphore. They then see that their parent
webserver structure *wserver* has been shutdown or restarted, and terminate
their waiting loop.  This should put the thread go into the exhausted state
and make it gc'able. Threads that are running (not semaphore-waiting) at the
time of the shutdown will  finish running, and will then see that a
unique-id WSERVER-RUNNING of their server has changed, and will take that as
a signal to quit.

The flaw that I see in my solution is that any worker threads currently
serving will continue to serve their request, and will quit only after
finishing their current page.  So any hung or infinitely long web pages will
continue to churn along if their parent webserver is killed.  One could fix
this by trying a process-kill after the semaphore signal is sent, but I'm
leery of it.

Caveat: I really don't know what I'm doing.

The new aserve/main.cl is hosted at:

    http://www.mediafire.com/?2jdwitdjjt1

I'll try to send it to the aserve list, but it looks dead.

On Tue, Sep 16, 2008 at 11:48 PM, John McAleely <john at mcaleely.com> wrote:

> I can replicate the same symptom on my CCL setup (Clozure Common Lisp
> Version 1.2-r9226-RC1  (DarwinX8664)).
>
> I had to make a few changes to acl-compat to get it to work on a
> recent build of ccl. Perhaps this is another area that needs to be
> examined? Is it known if this function has ever worked on ccl in the
> same way as allegro?
>
> J
>
>
> On 17 Sep 2008, at 10:23, JTK wrote:
>
> >
> > Hello again,
> >
> > I've found that the problem of un-restartable portable allegroserve
> > can be 'solved' by removing a  line in aserve/main.cl  in which
> > a list of worker threads is killed:
> >
> >    (dolist (th (wserver-worker-threads server))
> >     #+nil(acl-compat.mp:process-kill th) ;; get rid of this
> >     (acl-compat.mp:process-allow-schedule))
> >
> > One finds that (acl-compat.mp:process-kill th) is just a an alias for
> > (ccl:process-kill th)
> >
> > Evidently, killing threads breaks something.
> >
> > Is it safe just to remove references to the worker processes  and
> > let the garbage collector clean them up?  That is,
> > (setf (wserver-worker-threads server) nil).
> >
> > The problem is that the gc doesn't seem to reduce the processes left
> > behind by starting/stopping the server now, and the length of
> > (ccl:all-processes) just grows with the number of restarts even after
> > doing (gc)  between restarts.
> >
> > Sorry about these aserve questions, but it seems like the aserve
> > list is dead, and this involves some subtle internals of CCL.
> >
> > jan
> >
> >
> >
> >
> > On Sep 16, 2008, at 9:57 PM, JTK wrote:
> >
> >> Hello,
> >>
> >> I'm running CCL 1.2-r10552 PPC 32 and the latest CVS portableaserve
> >> (pretty old).
> >> This is on a G5 Mac with OS X 10.4.11
> >>
> >> I find that I can't restart the server. The first start works fine,
> >> but the subsequent ones freeze.
> >>
> >> eg:
> >>
> >> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> >> (net.aserve:start :port 8000)
> >> ;; server works OK
> >>
> >> (net.aserve:shutdown)
> >> ;; server stopped OK - no connections accepted
> >>
> >> (net.aserve:start :port 8000)
> >> ;; server now accepting connections, but the connection freezes
> >> ;; no log output appears.  A restarted server never works.
> >> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> >>
> >> I'm a bit stuck. Is anyone else using portable aserve?  Has anyone
> >> had
> >> success?  Or is
> >> there an updated version of aserve somewhere?  The aserve mail list
> >> is all spam, alas.
> >>
> >> Many thanks,
> >> Jan
> >
> > _______________________________________________
> > Openmcl-devel mailing list
> > Openmcl-devel at clozure.com
> > http://clozure.com/mailman/listinfo/openmcl-devel
> >
>
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.clozure.com/pipermail/openmcl-devel/attachments/20080917/ce05ed50/attachment.html>


More information about the Openmcl-devel mailing list