diff --git a/.rubocop.yml b/.rubocop.yml index cc7b2e5..7662da9 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -26,7 +26,7 @@ Metrics/CyclomaticComplexity: # Offense count: 5 # Configuration parameters: CountComments. Metrics/MethodLength: - Max: 150 + Max: 160 # Offense count: 3 Metrics/PerceivedComplexity: diff --git a/lib/fluent/plugin/exception_detector.rb b/lib/fluent/plugin/exception_detector.rb index 60a23b3..eaa835a 100644 --- a/lib/fluent/plugin/exception_detector.rb +++ b/lib/fluent/plugin/exception_detector.rb @@ -83,6 +83,8 @@ def self.supported GO_RULES = [ rule(:start_state, /\bpanic: /, :go_after_panic), + rule(:start_state, /http: panic serving/, :go_goroutine), + rule(:go_after_panic, /^$/, :go_goroutine), rule([:go_after_panic, :go_after_signal, :go_frame_1], /^$/, :go_goroutine), rule(:go_after_panic, /^\[signal /, :go_after_signal), diff --git a/test/plugin/test_exception_detector.rb b/test/plugin/test_exception_detector.rb index 983f696..1de0def 100644 --- a/test/plugin/test_exception_detector.rb +++ b/test/plugin/test_exception_detector.rb @@ -242,6 +242,26 @@ class ExceptionDetectorTest < Test::Unit::TestCase server.go:20 +0x91 END + GO_HTTP = <:0 @@ -585,6 +605,7 @@ def test_go check_exception(GO_EXC, false) check_exception(GO_ON_GAE_EXC, false) check_exception(GO_SIGNAL_EXC, false) + check_exception(GO_HTTP, false) end def test_ruby