Project

General

Profile

Actions

Bug #10514

closed

webrick fails with connection error when checking if socket is closed

Added by digininja (Robin x) over 9 years ago. Updated over 4 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]
[ruby-core:66292]

Description

In this version and previous

/usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/webrick/httpserver.rb

If the socket is closed early then the sock.eof? fails with a connection reset error

80 raise HTTPStatus::EOFError if sock.eof?

[2014-11-14 23:36:06] ERROR Errno::ECONNRESET: Connection reset by peer
/usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/webrick/httpserver.rb:84:in eof?' /usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/webrick/httpserver.rb:84:in run'
/usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'

I'm not sure why the socket is being closed early, probably a bug in something I'm doing in my code but I think this error should be caught and handled properly.

Updated by akr (Akira Tanaka) over 9 years ago

  • Status changed from Open to Feedback

The socket is not closed.

Errno::ECONNRESET is caused by a system call.
It is not possible if the socket is already closed.

"[2014-11-14 23:36:06]" is a header of webrick log.
So, webrick rescue the exception and logged it.

I don't see any problem.

Actions #2

Updated by jeremyevans0 (Jeremy Evans) over 4 years ago

  • Status changed from Feedback to Closed
Actions

Also available in: Atom PDF

Like0
Like0Like0