Skip to content

Conversation

@jasonopslevel
Copy link
Contributor

  • Propagate context to K8s operations instead of context.TODO() for graceful cancellation
  • Replace busy-wait loops with tickers in LogStreamer for efficiency
  • Add sync.Once to API client singletons for thread-safe initialization
  • Add context cancellation check in leader election loop for responsive shutdown
  • Remove redundant cobra.CheckErr call in API client validation
  • Fix redundant slice re-assignment in opslevelAppendLogProcessor
  • Extract container name constants in k8s.go for maintainability

Issues

Changelog

  • List your changes here
  • Make a changie entry

Tophatting

- Propagate context to K8s operations instead of context.TODO() for graceful cancellation
- Replace busy-wait loops with tickers in LogStreamer for efficiency
- Add sync.Once to API client singletons for thread-safe initialization
- Add context cancellation check in leader election loop for responsive shutdown
- Remove redundant cobra.CheckErr call in API client validation
- Fix redundant slice re-assignment in opslevelAppendLogProcessor
- Extract container name constants in k8s.go for maintainability

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
s.logger.Trace().Msg("Shutting down log streamer ...")
return
default:
case <-ticker.C:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the main offender for the performance issue, doing a busy-wait for log streaming. This makes the cpu go from 100% -> less than 1% per job.

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.

2 participants