dogstatsd-ruby 5.6.5 → 5.6.6
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/datadog/statsd/sender.rb +14 -4
- data/lib/datadog/statsd/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42286b47d2fc976ad7bd26781c36374083d3c2fab1d891b33a667438c5d72cee
|
4
|
+
data.tar.gz: 5855e821bffe5aea3c794164dc9c5eb7c2991cfa05a25ed599d32ce0f8a90f6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 510fe5033226ee7b626bff0fa57941a7be87d8ea3f9cd7b857b6aca8109fd04b3e1f2503f5981f126bc2e370abbe6172d136eb561b7776718248ca67f4a12e57
|
7
|
+
data.tar.gz: 746a5c12a4e183b33a3973b677c4706f4c4449b39cafbbcae009006db1d73b01b2c7113e601b8a326600332429f4b18a7d12c4a2ec8df618a75f8bed976f97f0
|
@@ -20,6 +20,7 @@ module Datadog
|
|
20
20
|
@mx = Mutex.new
|
21
21
|
@queue_class = queue_class
|
22
22
|
@thread_class = thread_class
|
23
|
+
@done = false
|
23
24
|
@flush_timer = if flush_interval
|
24
25
|
Datadog::Statsd::Timer.new(flush_interval) { flush(sync: true) }
|
25
26
|
else
|
@@ -66,8 +67,11 @@ module Datadog
|
|
66
67
|
# if the thread does not exist, we assume we are running in a forked process,
|
67
68
|
# empty the message queue and message buffers (these messages belong to
|
68
69
|
# the parent process) and spawn a new companion thread.
|
69
|
-
if !sender_thread.alive?
|
70
|
+
if sender_thread.nil? || !sender_thread.alive?
|
70
71
|
@mx.synchronize {
|
72
|
+
# an attempt was previously made to start the sender thread but failed.
|
73
|
+
# skipping re-start
|
74
|
+
return if @done
|
71
75
|
# a call from another thread has already re-created
|
72
76
|
# the companion thread before this one acquired the lock
|
73
77
|
break if sender_thread.alive?
|
@@ -96,9 +100,15 @@ module Datadog
|
|
96
100
|
|
97
101
|
# initialize a new message queue for the background thread
|
98
102
|
@message_queue = @queue_class.new
|
99
|
-
|
100
|
-
|
101
|
-
|
103
|
+
begin
|
104
|
+
# start background thread
|
105
|
+
@sender_thread = @thread_class.new(&method(:send_loop))
|
106
|
+
@sender_thread.name = "Statsd Sender" unless Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3')
|
107
|
+
rescue ThreadError => e
|
108
|
+
@logger.debug { "Statsd: Failed to start sender thread: #{e.message}" } if @logger
|
109
|
+
@mx.synchronize { @done = true }
|
110
|
+
end
|
111
|
+
|
102
112
|
@flush_timer.start if @flush_timer
|
103
113
|
end
|
104
114
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dogstatsd-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.6.
|
4
|
+
version: 5.6.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rein Henrichs
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2025-
|
12
|
+
date: 2025-03-19 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: A Ruby DogStatsd client
|
15
15
|
email: code@datadoghq.com
|
@@ -44,9 +44,9 @@ licenses:
|
|
44
44
|
- MIT
|
45
45
|
metadata:
|
46
46
|
bug_tracker_uri: https://github.com/DataDog/dogstatsd-ruby/issues
|
47
|
-
changelog_uri: https://github.com/DataDog/dogstatsd-ruby/blob/v5.6.
|
48
|
-
documentation_uri: https://www.rubydoc.info/gems/dogstatsd-ruby/5.6.
|
49
|
-
source_code_uri: https://github.com/DataDog/dogstatsd-ruby/tree/v5.6.
|
47
|
+
changelog_uri: https://github.com/DataDog/dogstatsd-ruby/blob/v5.6.6/CHANGELOG.md
|
48
|
+
documentation_uri: https://www.rubydoc.info/gems/dogstatsd-ruby/5.6.6
|
49
|
+
source_code_uri: https://github.com/DataDog/dogstatsd-ruby/tree/v5.6.6
|
50
50
|
post_install_message: |2+
|
51
51
|
|
52
52
|
If you are upgrading from v4.x of the dogstatsd-ruby library, note the major change to the threading model:
|