Skip to content

Conversation

@luiseterc
Copy link
Collaborator

Changes Made:

  1. Panic Recovery: Added a defer function that recovers from panics in sink operations, logs the error, properly closes the sink, and ensures the WaitGroup is decremented to prevent deadlocks.
  2. Timeout Protection :
  • Added a 30-second timeout constant for all sink Send operations
  • Each Send call now uses context.WithTimeout to prevent indefinite blocking
  • Timeout errors are logged at ERROR level with timeout duration for visibility
  • Context is always cancelled after Send to prevent resource leaks

These improvements ensure that:

  • If a sink panics, it won't crash the entire exporter
  • If a sink hangs, it will timeout after 30 seconds instead of blocking forever
  • Both scenarios are properly logged for debugging
  • The exporter continues processing events even when individual sinks fail

Fixes #8

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@luiseterc luiseterc merged commit 7248b52 into master Oct 14, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No Panic Recovery in Sink Send

2 participants