logstash-mixin-zeromq 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 581a303492a25d46f0bd462e8cddf2464d2cea18
4
- data.tar.gz: 460addf350a60201f1230e14c9450fcca928fb2f
3
+ metadata.gz: cec5dfe3f6667e06e871a68fba24a5bf23808a10
4
+ data.tar.gz: 66cc806229bdfb70d3cc1e82772459392fa976bd
5
5
  SHA512:
6
- metadata.gz: 01251b1a3cf3e13d59939e2f3bbe79b8139177c92777664845dd18e73747d588cece9c2402492864f7c16e4f9ad6c2a1674c9e8e83c166122e3d6528ee47953a
7
- data.tar.gz: 4cfd55e56dc3623912e5ddb5502159553e7b79347f1ecab4b86e57beefad84d14c1a342263299b0606996e9d0648e6f841d11fd5ab041e04c00d2d463f045e74
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.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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-mixin-zeromq
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic