bugsnag 2.8.2 → 2.8.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 43df7800cf5b29766a8eb2ee1574eea6549f9e0a
4
- data.tar.gz: 6c9478cd0c3dcf185b30e6266fbbe7bffc1ab26d
3
+ metadata.gz: 5515a540e3fb2c64492e1b17866d1b98e01e3602
4
+ data.tar.gz: 77d5ca101209931e27c4fb25e29203b44f0f5b10
5
5
  SHA512:
6
- metadata.gz: e961861ba8a71814253994d8c011166fa2b95c3c086ab795aa6ee4a0086f6affb09655426256684ccd0010033f3df1f32ef38353e49cfd693ef4b86c66e04849
7
- data.tar.gz: ca3916340b2c8d937481204bf36f1f6b523d0ebaf30ab48e1440107ba36d83dbbe9c35670bb1341bd95dce1f656cd2451fd7a05ff4f7eaa434d9ce074ddddd7a
6
+ metadata.gz: 0a99a13f3d350116dff3dd9f2312a5b7457d858aad5002bd96a7862916deaefaeca9a9fefb1e4cb54e6e731df1385f31098fdf45a891d18d4e7e96738dadaf4d
7
+ data.tar.gz: 142b85aa2765f6845195c7fa20f32955e232a79164dfefa1dbc2c47a0b6ee6c38e3f3c52c3c07f3c25f76e4d79fddfd2907a0bdc361977ef946aecb9646ccf9d
@@ -1,6 +1,12 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+
5
+ 2.8.3
6
+ -----
7
+
8
+ - Delay forking the delivery thread
9
+
4
10
  2.8.2
5
11
  -----
6
12
  - Fix various threading issues during library initialization
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.8.2
1
+ 2.8.3
@@ -5,10 +5,12 @@ module Bugsnag
5
5
  class ThreadQueue < Synchronous
6
6
  MAX_OUTSTANDING_REQUESTS = 100
7
7
  STOP = Object.new
8
-
8
+ MUTEX = Mutex.new
9
9
 
10
10
  class << self
11
11
  def deliver(url, body, configuration)
12
+ start_once!
13
+
12
14
  if queue.length > MAX_OUTSTANDING_REQUESTS
13
15
  Bugsnag.warn("Dropping notification, #{queue.length} outstanding requests")
14
16
  return
@@ -22,26 +24,28 @@ module Bugsnag
22
24
 
23
25
  attr_reader :queue
24
26
 
25
- def start!
26
- @queue = Queue.new
27
+ def start_once!
28
+ MUTEX.synchronize do
29
+ return if @started
30
+ @started = true
31
+
32
+ @queue = Queue.new
27
33
 
28
- worker_thread = Thread.new do
29
- while x = queue.pop
30
- break if x == STOP
31
- x.call
34
+ worker_thread = Thread.new do
35
+ while x = queue.pop
36
+ break if x == STOP
37
+ x.call
38
+ end
32
39
  end
33
- end
34
40
 
35
- at_exit do
36
- Bugsnag.warn("Waiting for #{queue.length} outstanding request(s)") unless queue.empty?
37
- queue.push STOP
38
- worker_thread.join
41
+ at_exit do
42
+ Bugsnag.warn("Waiting for #{queue.length} outstanding request(s)") unless queue.empty?
43
+ queue.push STOP
44
+ worker_thread.join
45
+ end
39
46
  end
40
47
  end
41
48
  end
42
-
43
- # do this once at require time to avoid race conditions
44
- start!
45
49
  end
46
50
  end
47
51
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bugsnag
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.2
4
+ version: 2.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-31 00:00:00.000000000 Z
11
+ date: 2015-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json