From 770653366c85b6514ebe672c89bc2e76725804c2 Mon Sep 17 00:00:00 2001 From: Maximilian Pass <22845248+mpass99@users.noreply.github.com> Date: Thu, 12 Sep 2024 15:01:05 +0200 Subject: [PATCH] Fix Sentry Debug Message for split debug messages by buffering a message when the message does not contain both start and end of a debug message. --- internal/nomad/sentry_debug_writer.go | 35 +++++++++++++++---- internal/nomad/sentry_debug_writer_test.go | 39 ++++++++++++++++++++++ 2 files changed, 67 insertions(+), 7 deletions(-) diff --git a/internal/nomad/sentry_debug_writer.go b/internal/nomad/sentry_debug_writer.go index cda283d0..2fedc281 100644 --- a/internal/nomad/sentry_debug_writer.go +++ b/internal/nomad/sentry_debug_writer.go @@ -1,6 +1,7 @@ package nomad import ( + "bytes" "context" "fmt" "io" @@ -22,8 +23,9 @@ var ( timeDebugMessagePattern = regexp.MustCompile( `(?P[\S\s]*?)\x1EPoseidon (?P[^\x1E]+?) (?P