<div dir="ltr"><br>Some more progress on aserve restarts failing.<br><br>The glitch that prevents aserve from restarting after a shutdown seems to be that worker threads waiting on a semaphore&nbsp; are killed with process-kill.&nbsp; Somehow, the semaphore and the kill don&#39;t mix.&nbsp;&nbsp; <br>
<br>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.&nbsp; This should put the thread go into the exhausted state and make it gc&#39;able. Threads that are running (not semaphore-waiting) at the time of the shutdown will&nbsp; 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.<br>
<br>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.&nbsp; So any hung or infinitely long web pages will continue to churn along if their parent webserver is killed.&nbsp; One could fix this by trying a process-kill after the semaphore signal is sent, but I&#39;m leery of it.<br>
<br>Caveat: I really don&#39;t know what I&#39;m doing.<br><br>The new aserve/<a href="http://main.cl" target="_blank">main.cl</a> is hosted at:<br>
<br>&nbsp;&nbsp;&nbsp; <a href="http://www.mediafire.com/?2jdwitdjjt1" target="_blank">http://www.mediafire.com/?2jdwitdjjt1</a><br><br>I&#39;ll try to send it to the aserve list, but it looks dead.<br><br><div class="gmail_quote">On Tue, Sep 16, 2008 at 11:48 PM, John McAleely <span dir="ltr">&lt;<a href="mailto:john@mcaleely.com" target="_blank">john@mcaleely.com</a>&gt;</span> wrote:<br>

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