logstash-logger 0.19.1 → 0.19.2
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/CHANGELOG.md +7 -0
- data/lib/logstash-logger/buffer.rb +27 -12
- data/lib/logstash-logger/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39bb1c811b357832fdd87f4f5c912244b4906d85
|
4
|
+
data.tar.gz: ac31561fa06f8e6eda9008f954596919771f1d1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86f24b4b12939ea038c60994dd6a278b03e59a5226bbb80587e667d79f78cc21c7c8819328b2eaecafe7b9651415fa4d0ebbc1dab75b464fc0f9534719fc129d
|
7
|
+
data.tar.gz: a696a3440c71cc46c49bdfe9c00e4f2b66135c348bfe50c1161cb4fb9e2b7dcb6e0794f3490955494e10032cdbb5e6b5542881318d013d9b197f695a49febfd7
|
data/CHANGELOG.md
CHANGED
@@ -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 =>
|
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 =>
|
123
|
+
:flush_mutex => flush_mutex,
|
124
124
|
|
125
125
|
# data for timed flushes
|
126
|
-
:last_flush =>
|
127
|
-
:timer =>
|
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
|
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.
|
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-
|
11
|
+
date: 2016-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logstash-event
|