From 9a881b3a2dc86faae0162ea1a7f616eaad622aec Mon Sep 17 00:00:00 2001 From: Seth Rylan Gainey Date: Thu, 2 Sep 2021 14:18:09 -0400 Subject: [PATCH 1/3] Add support for Reactor/Webflux formatted exceptions. --- lib/fluent/plugin/exception_detector.rb | 5 ++++- test/plugin/test_exception_detector.rb | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/lib/fluent/plugin/exception_detector.rb b/lib/fluent/plugin/exception_detector.rb index d7c78b4..52d5eb8 100644 --- a/lib/fluent/plugin/exception_detector.rb +++ b/lib/fluent/plugin/exception_detector.rb @@ -1,4 +1,4 @@ -# Copyright 2016 Google Inc. All rights reserved. +# Copyright 2021 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -59,6 +59,7 @@ def self.supported :java_start_exception), rule(:java_after_exception, /^[\r\n]*$/, :java_after_exception), rule([:java_after_exception, :java], /^[\t ]+(?:eval )?at /, :java), + rule([:java_after_exception, :java], /^[\t ]+(?:eval )?|_ checkpoint /, :java), rule([:java_after_exception, :java], # C# nested exception. @@ -73,6 +74,8 @@ def self.supported rule([:java_after_exception, :java], /^[\t ]*(?:Caused by|Suppressed):/, :java_after_exception), + rule([:java_after_exception, :java], /^(?:Error has been observed at the following site\(s\)|Stack trace):/, + :java), rule([:java_after_exception, :java], /^[\t ]*... \d+ (?:more|common frames omitted)/, :java) ].freeze diff --git a/test/plugin/test_exception_detector.rb b/test/plugin/test_exception_detector.rb index f001d0e..fa3d0c9 100644 --- a/test/plugin/test_exception_detector.rb +++ b/test/plugin/test_exception_detector.rb @@ -90,6 +90,28 @@ class ExceptionDetectorTest < Test::Unit::TestCase Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 <[REDACTED_EMAIL_ADDRESS]>... Relaying denied END + REACTOR_JAVA_EXC = < Date: Thu, 2 Sep 2021 16:33:03 -0400 Subject: [PATCH 2/3] Rubocop updates. --- lib/fluent/plugin/exception_detector.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/fluent/plugin/exception_detector.rb b/lib/fluent/plugin/exception_detector.rb index 52d5eb8..a4eb937 100644 --- a/lib/fluent/plugin/exception_detector.rb +++ b/lib/fluent/plugin/exception_detector.rb @@ -59,7 +59,8 @@ def self.supported :java_start_exception), rule(:java_after_exception, /^[\r\n]*$/, :java_after_exception), rule([:java_after_exception, :java], /^[\t ]+(?:eval )?at /, :java), - rule([:java_after_exception, :java], /^[\t ]+(?:eval )?|_ checkpoint /, :java), + rule([:java_after_exception, :java], /^[\t ]+(?:eval )?|_ checkpoint /, + :java), rule([:java_after_exception, :java], # C# nested exception. @@ -74,8 +75,10 @@ def self.supported rule([:java_after_exception, :java], /^[\t ]*(?:Caused by|Suppressed):/, :java_after_exception), - rule([:java_after_exception, :java], /^(?:Error has been observed at the following site\(s\)|Stack trace):/, + rule([:java_after_exception, :java], + /^(?:Error has been observed at the following site\(s\)):/, :java), + rule([:java_after_exception, :java], /^(?:Stack trace):/, :java), rule([:java_after_exception, :java], /^[\t ]*... \d+ (?:more|common frames omitted)/, :java) ].freeze From 908931bebc33459bbd67949a2c49539d6742206c Mon Sep 17 00:00:00 2001 From: Seth Rylan Gainey Date: Thu, 2 Sep 2021 16:35:19 -0400 Subject: [PATCH 3/3] Revert year change. --- lib/fluent/plugin/exception_detector.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fluent/plugin/exception_detector.rb b/lib/fluent/plugin/exception_detector.rb index a4eb937..b93e62d 100644 --- a/lib/fluent/plugin/exception_detector.rb +++ b/lib/fluent/plugin/exception_detector.rb @@ -1,4 +1,4 @@ -# Copyright 2021 Google Inc. All rights reserved. +# Copyright 2016 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.