fastbeans 0.3.6 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fastbeans/connection.rb +1 -1
- data/lib/fastbeans/errors.rb +2 -1
- data/lib/fastbeans/request.rb +9 -1
- data/lib/fastbeans/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5936875dd05eed4d051e79ade5a96ff780098367
|
4
|
+
data.tar.gz: 393572d7da151951bdf6d454094e3b52f0dfb149
|
5
5
|
!binary "U0hBNTEy":
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12a76b54d34d4279983c12be6d6b4ac507c0925b6de12a9d840ab32713d1db5714afbd5173a1f187fbf30f5114ce88b9f7ed6070a5abcfa993ca824e07528b01
|
7
|
+
data.tar.gz: f868e81095eca258bbd8c510bbcf45d353774bca61f83ce3d1f89a63616b3f3ee287666e16a33a5d5d06b9496ef71d9d9cf814ffeba2f1e22a939955728566e2
|
data/lib/fastbeans/connection.rb
CHANGED
@@ -44,7 +44,7 @@ module Fastbeans
|
|
44
44
|
retries = 0
|
45
45
|
begin
|
46
46
|
call_without_retries(data)
|
47
|
-
rescue Fastbeans::RemoteConnectionFailed => e
|
47
|
+
rescue Fastbeans::RemoteConnectionFailed, Fastbeans::ResponseReadTimeout => e
|
48
48
|
Fastbeans.debug(e)
|
49
49
|
if retries < MAX_RETRIES
|
50
50
|
Fastbeans.debug("Retrying (#{retries} out of #{MAX_RETRIES} retries)")
|
data/lib/fastbeans/errors.rb
CHANGED
@@ -10,5 +10,6 @@ module Fastbeans
|
|
10
10
|
class RemoteConnectionDead < Fastbeans::RPCException; end
|
11
11
|
class AutogeneratedException < Fastbeans::RPCException; end
|
12
12
|
class ResponseSignatureMismatch < RemoteConnectionFailed; end
|
13
|
-
|
13
|
+
class ResponseReadTimeout < RemoteCallFailed; end
|
14
|
+
|
14
15
|
end
|
data/lib/fastbeans/request.rb
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
require 'digest/md5'
|
2
2
|
require 'fastbeans/response'
|
3
|
+
require 'timeout'
|
3
4
|
|
4
5
|
module Fastbeans
|
5
6
|
class Request
|
6
7
|
attr_reader :connection
|
7
8
|
|
9
|
+
RESPONSE_READ_TIMEOUT = 120
|
10
|
+
|
8
11
|
def initialize(connection)
|
9
12
|
@connection = connection
|
10
13
|
end
|
@@ -29,8 +32,13 @@ module Fastbeans
|
|
29
32
|
end
|
30
33
|
|
31
34
|
def read_response(sock, call_data)
|
32
|
-
raw_resp =
|
35
|
+
raw_resp = Timeout.timeout(RESPONSE_READ_TIMEOUT, Fastbeans::ResponseReadTimeout) do
|
36
|
+
MessagePack.load(sock)
|
37
|
+
end
|
33
38
|
Fastbeans::Response.new(call_data, raw_resp)
|
39
|
+
rescue Fastbeans::ResponseReadTimeout
|
40
|
+
@connection.disconnect!
|
41
|
+
raise Fastbeans::ResponseReadTimeout, "Couldn't read response in #{RESPONSE_READ_TIMEOUT} seconds"
|
34
42
|
end
|
35
43
|
|
36
44
|
def perform(call_data)
|
data/lib/fastbeans/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastbeans
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dima Sabanin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: msgpack
|