logstash_writer 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/logstash_writer.rb +7 -7
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0aee91f724739c7f2a3c573dc323048217ca5bcda61728bad1e0daa01b5b6928
4
- data.tar.gz: 0e17940054d609ff3097b61b257d1488263c4eb1f13e6e5e3b14b00a9c561369
3
+ metadata.gz: 646455172093377861ec1c62178b4aca74473a8a816929ddfb33aafc0df959ef
4
+ data.tar.gz: dc6b57317bf8881e29606cb1fe784a3dd2e591e331156589cdfc80eb6e562862
5
5
  SHA512:
6
- metadata.gz: 7af085a2d487f1c21dedad9f7d897b219ae94047e5e38ce124a7a415f6a99e300220db21cb7ef3eaad3ad6cf474d68418b473bebe5d157b884acabebcf9e1ee0
7
- data.tar.gz: 2c0fde510617bb7785deec8c7f16f7a21be006f9c2c087f07d50ae3e1d0ec278b285fdca288c97fc736a862d9e6438394fce45ecbd60113ccce025583750a993
6
+ metadata.gz: 8583e8677dc1c238f4030a0a5e3f63b5b75319c17b9d81249f962d9e0b33e828b1bcdd4eaebd5a2104082d014bd7abf7c5332751efa2985bc4105b4ad86dd743
7
+ data.tar.gz: a99a3f8b3a0cc10033f110f9e047d30cc0d0a630cca536d36cb5502a1b3461c04721cc6ef063edd2da85ea7276f8b4b57c591b112b97f530d5f874d7bd1c8c82
@@ -94,7 +94,9 @@ class LogstashWriter
94
94
 
95
95
  metrics_registry.gauge(:"#{metrics_prefix}_queue_max", "The maximum size of the event queue").set({}, backlog)
96
96
 
97
- @queue = []
97
+ # We can't use a stdlib Queue object because we need to re-push items
98
+ # onto the front of the queue in case of error
99
+ @queue = []
98
100
  @queue_mutex = Mutex.new
99
101
  @queue_cv = ConditionVariable.new
100
102
 
@@ -144,12 +146,10 @@ class LogstashWriter
144
146
  def run
145
147
  @worker_mutex.synchronize do
146
148
  if @worker_thread.nil?
147
- m, cv = Mutex.new, ConditionVariable.new
148
-
149
- @worker_thread = Thread.new { cv.signal; write_loop }
150
-
151
- # Don't return until the thread has *actually* started
152
- m.synchronize { cv.wait(m) }
149
+ @worker_thread = Thread.new do
150
+ Thread.current.name = "LogstashWriter"
151
+ write_loop
152
+ end
153
153
  end
154
154
  end
155
155
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash_writer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Palmer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-05 00:00:00.000000000 Z
11
+ date: 2018-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: prometheus-client