appsignal 3.13.0-java → 3.13.1.alpha.1-java

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
  SHA256:
3
- metadata.gz: ebb12a4ab096308cdac9176f3575e5ac9c3a1afc7e330c8681d097302d29cdaf
4
- data.tar.gz: a5be1a3498ff49fe1e6de1d09abe81bb4d2ce2a5cc44a69e6fa45ebe9b9d8496
3
+ metadata.gz: c4474d04aa8cac43116e1f76b81ac598579d8a4a05e2e0ec05daee757c9562de
4
+ data.tar.gz: 45097354a9829e91237f2e1df8a2cd276e0f2e3a02313e15cfc9eb850402e8d2
5
5
  SHA512:
6
- metadata.gz: fc298f6b093e86d085ab2abf5da045d10aa51fd0a12f894b73d83632eca383589c89f49ced7054eab77c68d02468333622527c3e9dd4375d5627062773a0f9af
7
- data.tar.gz: 8311cc2b6c88447565c87cc231c50e3aa0640905cef72f400cb1620057ae22ef779da497dac76287ec9404957684fe838fd6c6471d9fcc5081b5cde94e747f05
6
+ metadata.gz: 9acb2c77b143318a6690fe25f9b48d8b15275c155060b37fc0ee5cb4050758399fb7709255c9b53f7d4ffe04863d5635f12040a8cc485baf38ab394b7d4c0f15
7
+ data.tar.gz: 70f260402383db4b540bb4c2842770b595f6249939c1c0ea5add11769ed0a853c9eb51474170c495e9b10ace9bee3b37c128daf9b4e72785d97554ad29ef8e19
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # AppSignal for Ruby gem Changelog
2
2
 
3
+ ## 3.13.1.alpha.1
4
+
5
+ _Published on 2024-08-22._
6
+
7
+ ### Changed
8
+
9
+ - Ignore `Errno::EPIPE` errors when instrumenting response bodies. We've noticed this error gets reported when the connection is broken between server and client. This happens in normal scenarios so we'll ignore this error in this scenario to avoid error reports from errors that cannot be resolved. (patch [8ad8a057](https://github.com/appsignal/appsignal-ruby/commit/8ad8a05787dcb12a5c7febc64559e7f145a59096))
10
+
3
11
  ## 3.13.0
4
12
 
5
13
  _Published on 2024-08-14._
@@ -4,6 +4,8 @@ module Appsignal
4
4
  module Rack
5
5
  # @api private
6
6
  class BodyWrapper
7
+ IGNORED_ERRORS = [Errno::EPIPE].freeze
8
+
7
9
  def self.wrap(original_body, appsignal_transaction)
8
10
  # The logic of how Rack treats a response body differs based on which methods
9
11
  # the body responds to. This means that to support the Rack 3.x spec in full
@@ -49,6 +51,8 @@ module Appsignal
49
51
  Appsignal.instrument("close_response_body.rack") { @body.close }
50
52
  end
51
53
  @body_already_closed = true
54
+ rescue *IGNORED_ERRORS # Do not report
55
+ raise
52
56
  rescue Exception => error # rubocop:disable Lint/RescueException
53
57
  @transaction.set_error(error)
54
58
  raise error
@@ -75,6 +79,8 @@ module Appsignal
75
79
  Appsignal.instrument("process_response_body.rack", "Process Rack response body (#each)") do
76
80
  @body.each(&blk)
77
81
  end
82
+ rescue *IGNORED_ERRORS # Do not report
83
+ raise
78
84
  rescue Exception => error # rubocop:disable Lint/RescueException
79
85
  @transaction.set_error(error)
80
86
  raise error
@@ -94,6 +100,8 @@ module Appsignal
94
100
  Appsignal.instrument("process_response_body.rack", "Process Rack response body (#call)") do
95
101
  @body.call(stream)
96
102
  end
103
+ rescue *IGNORED_ERRORS # Do not report
104
+ raise
97
105
  rescue Exception => error # rubocop:disable Lint/RescueException
98
106
  @transaction.set_error(error)
99
107
  raise error
@@ -118,6 +126,8 @@ module Appsignal
118
126
  ) do
119
127
  @body.to_ary
120
128
  end
129
+ rescue *IGNORED_ERRORS # Do not report
130
+ raise
121
131
  rescue Exception => error # rubocop:disable Lint/RescueException
122
132
  @transaction.set_error(error)
123
133
  raise error
@@ -134,6 +144,8 @@ module Appsignal
134
144
  ) do
135
145
  @body.to_path
136
146
  end
147
+ rescue *IGNORED_ERRORS # Do not report
148
+ raise
137
149
  rescue Exception => error # rubocop:disable Lint/RescueException
138
150
  @transaction.set_error(error)
139
151
  raise error
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Appsignal
4
- VERSION = "3.13.0"
4
+ VERSION = "3.13.1.alpha.1"
5
5
  end
@@ -72,6 +72,18 @@ describe Appsignal::Rack::BodyWrapper do
72
72
  expect(transaction).to have_error("ExampleException", "error message")
73
73
  end
74
74
 
75
+ it "doesn't report EPIPE error" do
76
+ fake_body = double
77
+ expect(fake_body).to receive(:each).once.and_raise(Errno::EPIPE)
78
+
79
+ wrapped = described_class.wrap(fake_body, transaction)
80
+ expect do
81
+ expect { |b| wrapped.each(&b) }.to yield_control
82
+ end.to raise_error(Errno::EPIPE)
83
+
84
+ expect(transaction).to_not have_error
85
+ end
86
+
75
87
  it "closes the body and tracks an instrumentation event when it gets closed" do
76
88
  fake_body = double(:close => nil)
77
89
  expect(fake_body).to receive(:each).once.and_yield("a").and_yield("b").and_yield("c")
@@ -134,6 +146,17 @@ describe Appsignal::Rack::BodyWrapper do
134
146
  expect(transaction).to have_error("ExampleException", "error message")
135
147
  end
136
148
 
149
+ it "doesn't report EPIPE error" do
150
+ expect(fake_body).to receive(:each).once.and_raise(Errno::EPIPE)
151
+
152
+ wrapped = described_class.wrap(fake_body, transaction)
153
+ expect do
154
+ expect { |b| wrapped.each(&b) }.to yield_control
155
+ end.to raise_error(Errno::EPIPE)
156
+
157
+ expect(transaction).to_not have_error
158
+ end
159
+
137
160
  it "reads out the body in full using to_ary" do
138
161
  expect(fake_body).to receive(:to_ary).and_return(["one", "two", "three"])
139
162
 
@@ -207,6 +230,17 @@ describe Appsignal::Rack::BodyWrapper do
207
230
  expect(transaction).to have_error("ExampleException", "error message")
208
231
  end
209
232
 
233
+ it "doesn't report EPIPE error" do
234
+ expect(fake_body).to receive(:to_path).once.and_raise(Errno::EPIPE)
235
+
236
+ wrapped = described_class.wrap(fake_body, transaction)
237
+ expect do
238
+ wrapped.to_path
239
+ end.to raise_error(Errno::EPIPE)
240
+
241
+ expect(transaction).to_not have_error
242
+ end
243
+
210
244
  it "exposes to_path to the sender" do
211
245
  allow(fake_body).to receive(:to_path).and_return("/tmp/file.bin")
212
246
 
@@ -259,5 +293,19 @@ describe Appsignal::Rack::BodyWrapper do
259
293
 
260
294
  expect(transaction).to have_error("ExampleException", "error message")
261
295
  end
296
+
297
+ it "doesn't report EPIPE error" do
298
+ fake_rack_stream = double
299
+ expect(fake_body).to receive(:call)
300
+ .with(fake_rack_stream)
301
+ .and_raise(Errno::EPIPE)
302
+
303
+ wrapped = described_class.wrap(fake_body, transaction)
304
+ expect do
305
+ wrapped.call(fake_rack_stream)
306
+ end.to raise_error(Errno::EPIPE)
307
+
308
+ expect(transaction).to_not have_error
309
+ end
262
310
  end
263
311
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appsignal
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.13.0
4
+ version: 3.13.1.alpha.1
5
5
  platform: java
6
6
  authors:
7
7
  - Robert Beekman
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-08-14 00:00:00.000000000 Z
13
+ date: 2024-08-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rack
@@ -503,7 +503,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
503
503
  - !ruby/object:Gem::Version
504
504
  version: '0'
505
505
  requirements: []
506
- rubygems_version: 3.3.7
506
+ rubygems_version: 3.5.14
507
507
  signing_key:
508
508
  specification_version: 4
509
509
  summary: Logs performance and exception data from your app to appsignal.com