Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.25.0

require (
github.com/coreos/go-systemd/v22 v22.6.0
github.com/getsentry/sentry-go v0.36.2
github.com/getsentry/sentry-go v0.39.0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Sentry events are lost on graceful shutdown because sentry.Flush() is not called for non-panic exits after the SDK upgrade introduced an async buffer.
Severity: CRITICAL | Confidence: High

🔍 Detailed Analysis

Sentry events buffered in memory are lost during normal application shutdown. This occurs because the Sentry SDK upgrade (v0.38.0+) enables an async telemetry buffer by default. The shutdownSentry() function in cmd/poseidon/main.go is designed to only call sentry.Flush() if a panic occurs, which does not happen during a graceful shutdown. Consequently, any events accumulated in the buffer are discarded without being sent to Sentry, leading to a loss of observability data.

💡 Suggested Fix

Add sentry.Flush() to the shutdownSentry() function to ensure buffered events are sent during graceful shutdowns. Alternatively, configure ClientOptions.DisableTelemetryBuffer to true in internal/config/config.go.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: go.mod#L7

Potential issue: Sentry events buffered in memory are lost during normal application
shutdown. This occurs because the Sentry SDK upgrade (v0.38.0+) enables an async
telemetry buffer by default. The `shutdownSentry()` function in `cmd/poseidon/main.go`
is designed to only call `sentry.Flush()` if a panic occurs, which does not happen
during a graceful shutdown. Consequently, any events accumulated in the buffer are
discarded without being sent to Sentry, leading to a loss of observability data.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 3356000

github.com/google/uuid v1.6.0
github.com/gorilla/mux v1.8.1
github.com/gorilla/websocket v1.5.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/getsentry/sentry-go v0.36.2 h1:uhuxRPTrUy0dnSzTd0LrYXlBYygLkKY0hhlG5LXarzM=
github.com/getsentry/sentry-go v0.36.2/go.mod h1:p5Im24mJBeruET8Q4bbcMfCQ+F+Iadc4L48tB1apo2c=
github.com/getsentry/sentry-go v0.39.0 h1:uhnexj8PNCyCve37GSqxXOeXHh4cJNLNNB4w70Jtgo0=
github.com/getsentry/sentry-go v0.39.0/go.mod h1:eRXCoh3uvmjQLY6qu63BjUZnaBu5L5WhMV1RwYO8W5s=
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
github.com/go-jose/go-jose/v3 v3.0.4 h1:Wp5HA7bLQcKnf6YYao/4kpRpVMp/yf6+pJKV8WFSaNY=
Expand Down
Loading