logstash-logger 0.19.1 → 0.19.2

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: d5e73bdbf504d36b2e6266e91dae7d1a5a033eeb
4
- data.tar.gz: 802ab34d3ab9d161deac72e7c7596b6d88b9c168
3
+ metadata.gz: 39bb1c811b357832fdd87f4f5c912244b4906d85
4
+ data.tar.gz: ac31561fa06f8e6eda9008f954596919771f1d1d
5
5
  SHA512:
6
- metadata.gz: cd059ec8dfde28adbc1e1107008c7d7bbb4832d1679ccda6e92d182d891e845a76c889451c017da3c1fdfb33b26a0a7d68a91a1c3b0fddd751abff33c65bb1f0
7
- data.tar.gz: 8f00d41ed68d4950a3d760a1acae66fe3a05dfcebd67efa0ab96cacce97d9c884cd489c407116e3daa6225ff3fb65bf747a14bd182bb09ad8ddcfa554a962cb5
6
+ metadata.gz: 86f24b4b12939ea038c60994dd6a278b03e59a5226bbb80587e667d79f78cc21c7c8819328b2eaecafe7b9651415fa4d0ebbc1dab75b464fc0f9534719fc129d
7
+ data.tar.gz: a696a3440c71cc46c49bdfe9c00e4f2b66135c348bfe50c1161cb4fb9e2b7dcb6e0794f3490955494e10032cdbb5e6b5542881318d013d9b197f695a49febfd7
@@ -1,3 +1,10 @@
1
+ ## 0.19.2
2
+
3
+ - Fixes mutex and memory leak issues when resetting buffer.
4
+ [#97](https://github.com/dwbutler/logstash-logger/issues/97)
5
+ [#98](https://github.com/dwbutler/logstash-logger/issues/98)
6
+ [#99](https://github.com/dwbutler/logstash-logger/issues/99)
7
+
1
8
  ## 0.19.1
2
9
 
3
10
  - Fixes compatibility with `ActiveRecord::SessionStore`. [#96](https://github.com/dwbutler/logstash-logger/pull/96)
@@ -113,28 +113,21 @@ module LogStashLogger
113
113
  :pending_count => 0,
114
114
 
115
115
  # guard access to pending_items & pending_count
116
- :pending_mutex => Mutex.new,
116
+ :pending_mutex => pending_mutex,
117
117
 
118
118
  # items which are currently being flushed
119
119
  :outgoing_items => {},
120
120
  :outgoing_count => 0,
121
121
 
122
122
  # ensure only 1 flush is operating at once
123
- :flush_mutex => Mutex.new,
123
+ :flush_mutex => flush_mutex,
124
124
 
125
125
  # data for timed flushes
126
- :last_flush => Time.now,
127
- :timer => Thread.new do
128
- loop do
129
- sleep(@buffer_config[:max_interval])
130
- begin
131
- buffer_flush(:force => true)
132
- rescue
133
- end
134
- end
135
- end
126
+ :last_flush => Time.now,
127
+ :timer => flush_timer_thread
136
128
  }
137
129
 
130
+
138
131
  # events we've accumulated
139
132
  buffer_clear_pending
140
133
  end
@@ -284,6 +277,28 @@ module LogStashLogger
284
277
  end
285
278
 
286
279
  private
280
+
281
+ def pending_mutex
282
+ @pending_mutex ||= Mutex.new
283
+ end
284
+
285
+ def flush_mutex
286
+ @flush_mutex ||= Mutex.new
287
+ end
288
+
289
+ def flush_timer_thread
290
+ @flush_timer_thread ||=
291
+ Thread.new do
292
+ loop do
293
+ sleep(@buffer_config[:max_interval])
294
+ begin
295
+ buffer_flush(:force => true)
296
+ rescue
297
+ end
298
+ end
299
+ end
300
+ end
301
+
287
302
  def buffer_clear_pending
288
303
  @buffer_state[:pending_items] = Hash.new { |h, k| h[k] = [] }
289
304
  @buffer_state[:pending_count] = 0
@@ -1,3 +1,3 @@
1
1
  module LogStashLogger
2
- VERSION = "0.19.1"
2
+ VERSION = "0.19.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.1
4
+ version: 0.19.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Butler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-27 00:00:00.000000000 Z
11
+ date: 2016-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logstash-event