Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

right_http_connection: restore release 1.2.1 source in svn

git-svn-id: https://wush.net/svn/rightscale/right_http_connection/release_1_2_1@3554 9f0cbaf6-ce18-0410-ad37-d14a22affa91
  • Loading branch information...
commit 543d9aec7a26bed41251d526c463f87c370dfd5e 1 parent 3e3d252
@konstantin-dzreev konstantin-dzreev authored
Showing with 3 additions and 11 deletions.
  1. +0 −4 History.txt
  2. +3 −7 lib/right_http_connection.rb
View
4 History.txt
@@ -39,8 +39,4 @@ Initial public release
* "RightAws: incompatible Net::HTTP monkey-patch" exception is raised if our net_fix
patch was overriden (by attachment_fu for example, to avoid this load attachment_fu
before loading the right_http_connection gem).
-
-* r3524, konstantin, 2008-04-17 11:35:42 +0400
- Fixed a problem with incorrect error handling (connection retries always failed).
-
View
10 lib/right_http_connection.rb
@@ -82,7 +82,7 @@ class HttpConnection
# Throw a Timeout::Error if a connection isn't established within this number of seconds
HTTP_CONNECTION_OPEN_TIMEOUT = 5
# Throw a Timeout::Error if no data have been read on this connnection within this number of seconds
- HTTP_CONNECTION_READ_TIMEOUT = 120
+ HTTP_CONNECTION_READ_TIMEOUT = 30
# Length of the post-error probationary period during which all requests will fail
HTTP_CONNECTION_RETRY_DELAY = 15
@@ -284,14 +284,10 @@ def request(request_params, &block)
# if we are inside a delay between retries: no requests this time!
if error_count > HTTP_CONNECTION_RETRY_COUNT \
&& error_time + HTTP_CONNECTION_RETRY_DELAY > Time.now
- # store the message (otherwise it will be lost after error_reset and
- # we will raise an exception with an empty text)
- banana_message_text = banana_message
- @logger.warn("#{err_header} re-raising same error: #{banana_message_text} " +
+ @logger.warn("#{err_header} re-raising same error: #{banana_message} " +
"-- error count: #{error_count}, error age: #{Time.now.to_i - error_time.to_i}")
- error_reset
exception = get_param(:exception) || RuntimeError
- raise exception.new(banana_message_text)
+ raise exception.new(banana_message)
end
# try to connect server(if connection does not exist) and get response data
Please sign in to comment.
Something went wrong with that request. Please try again.