logstash-mixin-zeromq 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/logstash/plugin_mixins/zeromq.rb +2 -2
- data/logstash-util-zeromq.gemspec +1 -1
- data/spec/plugin_mixins/zeromq_spec.rb +13 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cec5dfe3f6667e06e871a68fba24a5bf23808a10
|
4
|
+
data.tar.gz: 66cc806229bdfb70d3cc1e82772459392fa976bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d04902c5705478eafd9e2356ea0647dc141c0cbcb0bc94f281bb722be63bea81c54aeade0788edbe5e8de08bc3267a203016485db801e016da83dbd9d640a12
|
7
|
+
data.tar.gz: 4c8010338df5598bf0fee3e0798e8cde399a8e5ed15199f436d01d700807186653d3a4e024d0223f416696b0cfcf115cb3f8a57bec03c8c30a303f940c44e0c7
|
@@ -20,8 +20,8 @@ module LogStash::PluginMixins::ZeroMQ
|
|
20
20
|
@logger.info("0mq: #{server? ? 'connected' : 'bound'}", :address => address)
|
21
21
|
end
|
22
22
|
|
23
|
-
def error_check(rc, doing)
|
24
|
-
unless ZMQ::Util.resultcode_ok?(rc)
|
23
|
+
def error_check(rc, doing, eagain_not_error=false)
|
24
|
+
unless ZMQ::Util.resultcode_ok?(rc) || (ZMQ::Util.errno == ZMQ::EAGAIN && eagain_not_error)
|
25
25
|
@logger.error("ZeroMQ error while #{doing}", { :error_code => rc })
|
26
26
|
raise "ZeroMQ Error while #{doing}"
|
27
27
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-mixin-zeromq'
|
4
|
-
s.version = '2.0.
|
4
|
+
s.version = '2.0.1'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "Mixin to share code for zeromq input, output and filter"
|
7
7
|
s.description = "This gem contains mixin functions, used by 0MQ logstash plugins. This gem is not a stand-alone program"
|
@@ -43,10 +43,10 @@ describe LogStash::PluginMixins::ZeroMQ do
|
|
43
43
|
end
|
44
44
|
|
45
45
|
context "a client" do
|
46
|
-
let(:impl_client) {
|
46
|
+
let(:impl_client) {
|
47
47
|
d = Dummy.new(basic_config)
|
48
48
|
d.mode = "client"
|
49
|
-
d
|
49
|
+
d
|
50
50
|
}
|
51
51
|
|
52
52
|
it "should setup a client, connecting to address without error" do
|
@@ -64,6 +64,16 @@ describe LogStash::PluginMixins::ZeroMQ do
|
|
64
64
|
expect { impl.error_check(-1, "test return values" ) }.to raise_error
|
65
65
|
expect { impl.error_check(-999, "test return values" ) }.to raise_error
|
66
66
|
end
|
67
|
+
|
68
|
+
it "should raise an error for ZMQ::EAGAIN if eagain_not_error=false" do
|
69
|
+
allow(ZMQ::Util).to receive(:errno).and_return(ZMQ::EAGAIN)
|
70
|
+
expect { impl.error_check(-1, "test return values", false) }.to raise_error
|
71
|
+
end
|
72
|
+
|
73
|
+
it "should not raise an error for ZMQ::EAGAIN if eagain_not_error=true" do
|
74
|
+
allow(ZMQ::Util).to receive(:errno).and_return(ZMQ::EAGAIN)
|
75
|
+
expect { impl.error_check(-1, "test return values", true) }.to_not raise_error
|
76
|
+
end
|
67
77
|
end
|
68
78
|
|
69
79
|
context "when socketopts" do
|
@@ -92,4 +102,4 @@ describe LogStash::PluginMixins::ZeroMQ do
|
|
92
102
|
end
|
93
103
|
|
94
104
|
end
|
95
|
-
end
|
105
|
+
end
|