Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(engine): improve Engine.Start error handling #2322

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lukema95
Copy link

Description

This PR improves the error handling in the Engine.Start method. The current implementation uses panic to handle errors, which could lead to program crashes and makes error handling difficult for upstream callers.

Changes

  • Replace panic with proper error handling using channels
  • Add context cancellation handling
  • Improve error logging and observability
  • Make startup process more reliable and controllable

return nil

select {
case err := <-errChan:
Copy link

Choose a reason for hiding this comment

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

This changes the behavior of Start. Previously, we'd exit as soon as goroutine was spawned. Now we're waiting for Start to finish (blocking select). What's the point of having a goroutine then?

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