chicken-janitors
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-janitors] #858: spiffy-request-vars' test shows "cannot wri


From: Chicken Trac
Subject: Re: [Chicken-janitors] #858: spiffy-request-vars' test shows "cannot write to socket - Broken pipe" at random
Date: Fri, 01 Jun 2012 22:46:16 -0000

#858: spiffy-request-vars' test shows "cannot write to socket - Broken pipe" at
random
-----------------------+----------------------------------------------------
  Reporter:  mario     |       Owner:                                           
               
      Type:  defect    |      Status:  new                                      
               
  Priority:  critical  |   Milestone:  4.8.0                                    
               
 Component:  unknown   |     Version:  4.7.x                                    
               
Resolution:            |    Keywords:  spiffy-request-vars, cannot write to 
socket, broken pipe
-----------------------+----------------------------------------------------

Comment(by mario):

 Here's a simpler code snippet that can be used to reproduce a similar
 problem:

 Server part:

 {{{
 $ csi -e '(use spiffy) (start-server)'
 }}}

 Client part:

 {{{
 $ cat client.scm
 (use http-client)

 (define (get path)
   (let ((val (handle-exceptions exn
                'ignore
                (with-input-from-request
                 (string-append "http://localhost:8080"; path)
                 #f
                 read-string))))
     (close-all-connections!)
     val))

 (let loop ((i 0))
   (unless (= i 10000)
     (print i)
     (get "/foo")
     (loop (+ i 1))))

 $ csi -s client.scm
 }}}

 I suspect the error is caused by some client issue, since I don't get any
 error when hitting the server with ab.

 By stracing the client, I could see it stops on {{{select}}}:

 {{{
 connect(4, {sa_family=AF_INET, sin_port=htons(8080),
 sin_addr=inet_addr("127.0.0.1")}, 16) = -1 EINPROGRESS (Operation now in
 progress)
 select(5, NULL, [4], NULL, {0, 0})      = 1 (out [4], left {0, 0})
 getsockopt(4, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
 fcntl64(4, F_GETFL)                     = 0x802 (flags O_RDWR|O_NONBLOCK)
 fcntl64(4, F_SETFL, O_RDWR|O_NONBLOCK)  = 0
 send(4, "GET", 3, 0)                    = 3
 send(4, " ", 1, 0)                      = 1
 send(4, "/foo", 4, 0)                   = 4
 send(4, " HTTP/", 6, 0)                 = 6
 send(4, "1", 1, 0)                      = 1
 send(4, ".", 1, 0)                      = 1
 send(4, "1", 1, 0)                      = 1
 send(4, "\r\n", 2, 0)                   = 2
 send(4, "Host", 4, 0)                   = 4
 send(4, ": ", 2, 0)                     = 2
 send(4, "localhost:8080", 14, 0)        = 14
 send(4, "\r\n", 2, 0)                   = 2
 send(4, "User-Agent", 10, 0)            = 10
 send(4, ": ", 2, 0)                     = 2
 send(4, "Chicken Scheme HTTP-client/0.5", 30, 0) = 30
 send(4, "\r\n", 2, 0)                   = 2
 send(4, "\r\n", 2, 0)                   = 2
 recv(4, 0xb7704df8, 1024, 0)            = -1 EAGAIN (Resource temporarily
 unavailable)
 gettimeofday({1338590646, 168171}, NULL) = 0
 gettimeofday({1338590646, 168201}, NULL) = 0
 gettimeofday({1338590646, 168229}, NULL) = 0
 select(1024, [4], [], NULL, {60, 0}
 }}}

-- 
Ticket URL: <http://bugs.call-cc.org/ticket/858#comment:2>
Chicken Scheme <http://www.call-with-current-continuation.org/>
Chicken Scheme is a compiler for the Scheme programming language.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]