[#1884] multiple exceptions for assert_raises — nobu.nokada@...

Hi,

14 messages 2003/12/04

[#1932] --enable-pthread broken? — Nathaniel Talbott <nathaniel@...>

[ruby-talk: 87759] and the surrounding thread seem to indicate that

29 messages 2003/12/11
[#1933] Re: --enable-pthread broken? — matz@... (Yukihiro Matsumoto) 2003/12/11

Hi,

[#1934] Re: --enable-pthread broken? — Nathaniel Talbott <nathaniel@...> 2003/12/11

On Dec 11, 2003, at 11:49, Yukihiro Matsumoto wrote:

[#1935] Re: --enable-pthread broken? — ts <decoux@...> 2003/12/11

>>>>> "N" == Nathaniel Talbott <nathaniel@talbott.ws> writes:

[#1937] Re: --enable-pthread broken? — nobu.nokada@... 2003/12/11

Hi,

[#1938] Re: --enable-pthread broken? — Nathaniel Talbott <nathaniel@...> 2003/12/12

On Dec 11, 2003, at 16:10, nobu.nokada@softhome.net wrote:

[#1939] Re: --enable-pthread broken? — matz@... (Yukihiro Matsumoto) 2003/12/12

Hi,

[#1941] Re: --enable-pthread broken? — matz@... (Yukihiro Matsumoto) 2003/12/12

Hi,

[#1943] Re: --enable-pthread broken? — Nathaniel Talbott <nathaniel@...> 2003/12/12

On Dec 11, 2003, at 20:48, Yukihiro Matsumoto wrote:

[#1953] Re: --enable-pthread broken? — matz@... (Yukihiro Matsumoto) 2003/12/13

Hi,

[#1959] Re: --enable-pthread broken? — ts <decoux@...> 2003/12/14

>>>>> "Y" == Yukihiro Matsumoto <matz@ruby-lang.org> writes:

[#1961] Re: --enable-pthread broken? — matz@... (Yukihiro Matsumoto) 2003/12/15

Hi,

[#1962] Re: --enable-pthread broken? — ts <decoux@...> 2003/12/15

>>>>> "Y" == Yukihiro Matsumoto <matz@ruby-lang.org> writes:

[#1936] Can't define +@ for Symbol (plus ruby install problem) — "T. Onoma" <transami@...>

I wanted to see if the +@ problem was fixed in 1.8.1 preview 3 but when I do

11 messages 2003/12/11

[#1973] Where to install documentation — Dave Thomas <dave@...>

Folks:

48 messages 2003/12/15
[#1982] Re: Where to install documentation — Eric Hodel <drbrain@...7.net> 2003/12/15

Dave Thomas (dave@pragprog.com) wrote:

[#1984] Re: Where to install documentation — Dave Thomas <dave@...> 2003/12/15

[#1991] Re: Where to install documentation — "Gavin Sinclair" <gsinclair@...> 2003/12/16

>

[#1992] Re: Where to install documentation — Dave Thomas <dave@...> 2003/12/16

[#2000] Re: Where to install documentation — Minero Aoki <aamine@...> 2003/12/16

Hi,

[#2002] Re: Where to install documentation — Dave Thomas <dave@...> 2003/12/16

[#2037] --enable-pthread still segfaults... — Nathaniel Talbott <nathaniel@...>

I've finally been able to test my application under load using the

25 messages 2003/12/23
[#2038] Re: --enable-pthread still segfaults... — matz@... (Yukihiro Matsumoto) 2003/12/23

Hi,

[#2039] Re: --enable-pthread still segfaults... — Nathaniel Talbott <nathaniel@...> 2003/12/23

On Dec 23, 2003, at 14:17, Yukihiro Matsumoto wrote:

[#2040] Re: --enable-pthread still segfaults... — matz@... (Yukihiro Matsumoto) 2003/12/23

Hi,

[#2041] Re: --enable-pthread still segfaults... — Nathaniel Talbott <nathaniel@...> 2003/12/23

On Dec 23, 2003, at 14:34, Yukihiro Matsumoto wrote:

[#2042] Re: --enable-pthread still segfaults... — matz@... (Yukihiro Matsumoto) 2003/12/23

Hi,

[#2043] Re: --enable-pthread still segfaults... — Nathaniel Talbott <nathaniel@...> 2003/12/23

On Dec 23, 2003, at 14:44, Yukihiro Matsumoto wrote:

[#2045] Re: --enable-pthread still segfaults... — matz@... (Yukihiro Matsumoto) 2003/12/23

Hi,

[#2046] Re: --enable-pthread still segfaults... — Nathaniel Talbott <nathaniel@...> 2003/12/23

> I'm afraid you're using old configure file. Can you wipe off old

[#2049] Re: --enable-pthread still segfaults... — Nathaniel Talbott <nathaniel@...> 2003/12/23

On Dec 23, 2003, at 15:18, Nathaniel Talbott wrote:

[#2050] Re: --enable-pthread still segfaults... — matz@... (Yukihiro Matsumoto) 2003/12/23

In message "Re: --enable-pthread still segfaults..."

[#2122] Bad interaction between timeout.rb and --enable-pthread — Nathaniel Talbott <nathaniel@...>

Here's a testcase that shows the problem:

13 messages 2003/12/31
[#2123] sleep is broken with --enable-pthread [Was: Bad interaction between timeout.rb and --enable-pthread] — Nathaniel Talbott <nathaniel@...> 2003/12/31

I should have reduced it more before posting...

WEBrick bug & fix

From: Nathaniel Talbott <nathaniel@...>
Date: 2003-12-01 20:50:53 UTC
List: ruby-core #1853
I have a production WEBrick server whose common usage includes clients 
making requests and then disconnecting before a response can be given. 
There is a bug in WEBrick::GenericServer#start_thread that can cause 
threads to silently die under these conditions, causing the thread pool 
to eventually be exhausted, triggering the error reported in 
ruby-talk:86309. Basically, the call to sock.peeraddr can result in an 
exception being raised, which causes the addr local variable to be nil 
when the ensure block is executed, raising an additional exception 
which is not handled.

The patch below should fix that bug. I've also included some improved 
error-handling which rescues all Exceptions (not just StandardError), 
and keeps the server a bit quieter under normal operation.

Let me know if you have any questions or need more info about the patch.

Thanks,


Nathaniel

<:((><


Index: lib/webrick/httpresponse.rb
===================================================================
RCS file: /src/ruby/lib/webrick/httpresponse.rb,v
retrieving revision 1.2
diff -u -r1.2 httpresponse.rb
--- lib/webrick/httpresponse.rb	25 Nov 2003 16:02:45 -0000	1.2
+++ lib/webrick/httpresponse.rb	1 Dec 2003 20:25:26 -0000
@@ -84,10 +84,10 @@
          setup_header()
          send_header(socket)
          send_body(socket)
-      rescue Errno::EPIPE
-        @logger.error("HTTPResponse#send_response: EPIPE occured.")
+      rescue Errno::EPIPE, Errno::ECONNRESET, Errno::ENOTCONN => ex
+        @logger.debug(ex)
          @keep_alive = false
-      rescue => ex
+      rescue Exception => ex
          @logger.error(ex)
          @keep_alive = false
        end
Index: lib/webrick/server.rb
===================================================================
RCS file: /src/ruby/lib/webrick/server.rb,v
retrieving revision 1.4
diff -u -r1.4 server.rb
--- lib/webrick/server.rb	23 Oct 2003 11:29:29 -0000	1.4
+++ lib/webrick/server.rb	1 Dec 2003 20:25:26 -0000
@@ -102,7 +102,7 @@
            rescue Errno::EBADF, IOError => ex
              # if the listening socket was closed in 
GenericServer#shutdown,
              # IO::select raise it.
-          rescue => ex
+          rescue Exception => ex
              msg = "#{ex.class}: #{ex.message}\n\t#{ex.backtrace[0]}"
              @logger.error msg
            end
@@ -148,14 +148,20 @@
            @logger.debug "accept: #{addr[3]}:#{addr[1]}"
            call_callback(:AcceptCallback, sock)
            block ? block.call(sock) : run(sock)
-        rescue ServerError, Errno::ENOTCONN => ex
+        rescue Errno::ENOTCONN
+          @logger.debug "Errno::ENOTCONN raised"
+        rescue ServerError => ex
            msg = "#{ex.class}: #{ex.message}\n\t#{ex.backtrace[0]}"
            @logger.error msg
          rescue Exception => ex
            @logger.error ex
          ensure
            Thread.current[:WEBrickSocket] = nil
-          @logger.debug "close: #{addr[3]}:#{addr[1]}"
+          if(addr)
+            @logger.debug "close: #{addr[3]}:#{addr[1]}"
+          else
+            @logger.debug "close: nil"
+          end
            sock.close
          end
          @tokens.push(nil)


In This Thread

Prev Next