default   Racket Bugs
Main PageQuick QueryStandard QueryAdvanced QueryHelp
Log in

View Problem Report: 12443

send email to interested parties or send email followup to audit-trail
Reporter's email: griffinish at gmail dot com
Number: 12443
Category: web-server
Synopsis: serve/servlet crashes on simultaneous connections
Class: sw-bug
Responsible: jay
Notify-List:
Severity: critical
Priority: medium
State: closed
Confidential: no
Arrival-Date: Thu Dec 15 12:56:01 -0500 2011
Closed-Date: Tue Jan 03 17:05:45 -0500 2012
Last-Modified: Fri Mar 23 12:48:13 -0400 2012
Originator: John Griffin
Organization: plt
Submitter-Id: unknown
Release: 5.2.0.6
Environment: macosx "Darwin JGiMac24.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386 i386" (i386-macosx/3m) (get-display-depth) = 32
Human Language: english
(current-memory-use) 106219148
Links: (links) = ("cumulus"); (links #:user? #f) = (); (links #:root? #t) = (); (links #:user? #f #:root? #t) = ()


Collections:
("/Users/john/Library/Racket/5.2.0.6/collects"
(non-existent-path))
("/Users/john/Racket-v5.2.0.6/collects"
("2htdp" "algol60" "at-exp" "browser" "combinator-parser" "compiler" "config" "data" "datalog" "db" "defaults" "deinprogramm" "drracket" "drscheme" "dynext" "embedded-gui" "eopl" "errortrace" "ffi" "file" "framework" "frtime" "games" "graphics" "gui-debugger" "help" "hierlist" "htdp" "html" "icons" "info-domain" "lang" "launcher" "lazy" "macro-debugger" "make" "mred" "mrlib" "mysterx" "mzcom" "mzlib" "mzscheme" "net" "openssl" "parser-tools" "picturing-programs" "plai" "planet" "plot" "preprocessor" "profile" "r5rs" "r6rs" "racket" "racklog" "rackunit" "raco" "reader" "readline" "redex" "repo-time-stamp" "rnrs" "s-exp" "scheme" "schemeunit" "scribble" "scribblings" "scriblib" "setup" "sgl" "slatex" "slideshow" "srfi" "stepper" "string-constants" "swindle" "syntax" "syntax-color" "teachpack" "test-box-recovery" "test-engine" "tex2page" "texpict" "trace" "typed" "typed-racket" "typed-scheme" "unstable" "version" "web-server" "wxme" "xml" "xrepl"))

Computer Language: (("Determine language from source") (#(#t print mixed-fraction-e #f #t debug) (default) #() "#lang racket/base\n" #f #t))
Description: When exposed to more than one simultaneous request from the Apache "ab" program, "custodian has been shut down" error is raised in serve/servlet.  Failure happens within a few hundred requests, sometimes a couple of thousand requests on this OSX Snow Leopard as well as a debian squeeze also running racket 5.2.0.6.  With no simultaneous requests (i.e. not using -c 2), there is no failure.
File Attachments:
How-To-Repeat: #lang racket

(require web-server/dispatch
         web-server/servlet-env
         web-server/http/xexpr)

(define-values (the-dispatch the-url)
  (dispatch-rules
   [("account" "sample") sample ]))

(define (sample req)
  (response/xexpr
   `(html
     (body
      (p "Hello custodian")))))

(serve/servlet the-dispatch
               #:stateless? #t
               #:banner? #f
               #:port 55555
               #:servlet-regexp #rx""                                   
               #:launch-browser? #f)
-----
Then hit it with Apache benchmark with a -c 2 option to cause simultaneous hits.
ab -n 10000 -c 2 http://localhost:55555/account/sample
Fix:
Release-Note:
Unformatted:

send email to interested parties or send email followup to audit-trail

Audit Trail:

State changed from "open" to "closed" by jay at racket-lang.org at Tue, 03 Jan 2012 17:05:45 -0500
Reason>>> A commit by jay at racket-lang.org has resolved this report
  http://git.racket-lang.org/plt/commit/022ce2d8d7
From: John Griffin <griffinish at gmail.com>
To: bugs at racket-lang.org
Cc: jay at racket-lang.org, sk at racket-lang.org, matthias at racket-lang.org
Subject: Re: [racket-bug] web-server/12443 serve/servlet crashes on
 simultaneous connections
Date: Tue, 3 Jan 2012 19:33:30 -0500

 --0015174c0f7609c66e04b5a8f7a7
 Content-Type: text/plain; charset=ISO-8859-1
 
 Thanks, many thanks.  I looked at the thread code and it clearly was not a
 small thing to fix.  I'll start by saying thanks and finish with doing some
 testing.
 
 By the way, I'm using this for real hiding behind Nginx.  I let nginx serve
 the static stuff and be an HTTP 1.1 front end and Racket do the logic.  I
 oscillated between using the stateless Racket web server as the backend and
 Racket as an SCGI server.
 
 Thanks again to you and your co-racketeers.
 
 John Griffin
 
 On Tue, Jan 3, 2012 at 5:05 PM, <jay at racket-lang.org> wrote:
 
 >
 > State changed from "open" to "closed" by jay at racket-lang.org at Tue, 03
 > Jan 2012 17:05:45 -0500
 > Reason>>> A commit by jay at racket-lang.org has resolved this report
 >  http://git.racket-lang.org/plt/commit/022ce2d8d7
 >
 > View:
 >  http://bugs.racket-lang.org/query/?cmd=view&pr=12443
 >
 >
 
 --0015174c0f7609c66e04b5a8f7a7
 Content-Type: text/html; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable
 
 Thanks, many thanks. =A0I looked at the thread code and it clearly was not =
 a small thing to fix. =A0I&#39;ll start by saying thanks and finish with do=
 ing some testing. =A0<div><br></div><div>By the way, I&#39;m using this for=
  real hiding behind Nginx. =A0I let nginx serve the static stuff and be an =
 HTTP 1.1 front end and Racket do the logic. =A0I oscillated between using t=
 he stateless Racket web server as the backend and Racket as an SCGI server.=
  =A0<div>
 <br></div><div>Thanks again to you and your co-racketeers.</div><div><br></=
 div><div>John Griffin<br><br><div class=3D"gmail_quote">On Tue, Jan 3, 2012=
  at 5:05 PM,  <span dir=3D"ltr">&lt;<a href=3D"mailto:jay at racket-lang.org">=
 jay at racket-lang.org</a>&gt;</span> wrote:<br>
 <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
 x #ccc solid;padding-left:1ex"><br>
 State changed from &quot;open&quot; to &quot;closed&quot; by <a href=3D"mai=
 lto:jay at racket-lang.org">jay at racket-lang.org</a> at Tue, 03 Jan 2012 17:05:=
 45 -0500<br>
 Reason&gt;&gt;&gt; A commit by <a href=3D"mailto:jay at racket-lang.org">jay@r=
 acket-lang.org</a> has resolved this report<br>
  =A0<a href=3D"http://git.racket-lang.org/plt/commit/022ce2d8d7" target=3D"=
 _blank">http://git.racket-lang.org/plt/commit/022ce2d8d7</a><br>
 <br>
 View:<br>
  =A0<a href=3D"http://bugs.racket-lang.org/query/?cmd=3Dview&amp;pr=3D12443=
 " target=3D"_blank">http://bugs.racket-lang.org/query/?cmd=3Dview&amp;pr=3D=
 12443</a><br>
 <br>
 </blockquote></div><br></div></div>
 
 --0015174c0f7609c66e04b5a8f7a7--

----------
A commit by jay at racket-lang.org was marked as relevant
  http://git.racket-lang.org/plt/commit/9b579d8c2a