[plt-scheme] Seeing some timeout issues with web-server

From: Daniel Yoo (dyoo at cs.wpi.edu)
Date: Wed Mar 28 19:13:15 EDT 2007

Hi everyone,

I'm seeing some issues where the timeout used for servlets is the default 
one --- TIMEOUTS-DEFAULT-SERVLET --- rather than the one defined by the 
module itself.  I've made a small patch which seems to fix the issue for 
me, but I have to admit I don't fully understand the problem yet.

(Andrey, the issue we were seeing today was exactly the servlet timeouts 
triggering off.)


The patch I've done is:

-----------------------------------------------------------------------
dyoo at dyoo-desktop:~/local/plt-svn/collects/web-server$ svn diff
Index: dispatchers/dispatch-servlets.ss
===================================================================
--- dispatchers/dispatch-servlets.ss    (revision 5841)
+++ dispatchers/dispatch-servlets.ss    (working copy)
@@ -357,7 +357,7 @@
                                  (create-timeout-manager

default-servlet-instance-expiration-handler
                                   timeouts-servlet-connection
-                                 timeouts-default-servlet)
+                                 timeout)
                                  (v1.module->v1.lambda timeout start)))]
                 [(v2-transitional) ; XXX: Undocumented
                  (let ([start (dynamic-require module-name 'start)]
------------------------------------------------------------------------

where the timeout-manager knows up front what the default servlet timeout 
should be, rather than be told it by mutation through a call to 
adjust-timeout! later on.


I can tell that this works because the default timeout is thirty seconds 
or so on my configuration-table, whereas the timeout in this particular 
servlet is defined to be fifteen minutes.


I think I've figured out why the call to ADJUST-TIMEOUT! in the 
constructed lambda appears to have no effect.  I have isolated it down to 
the effect of the call to managers/timeouts.ss's CONTINUATION-STORE!.  It 
flips on an additional timer to reap continuations.  But ADJUST-TIMEOUT! 
doesn't do anything to mutate the timer started in CONTINUATION-STORE!. 
I think that's the exact issue I've been seeing.


So I think the patch above is necessary: otherwise, module timeout is 
nonsensical.  Ideally, ADJUST-TIMEOUT! should probably also affect the 
continuation-timer-length used by CONTINUATION-STORE!


Best of wishes!


Posted on the users mailing list.