Repository navigation
fix: return error instead of panicking on execution engine start failure - #725
Open
RohithPariki wants to merge 1 commit into
Open
RohithPariki wants to merge 1 commit into
RohithPariki wants to merge 1 commit into
Conversation
This commit improves the reliability of the execution engine startup by returning an error up the stack to main instead of immediately panicking, allowing graceful handling of startup failures.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improves the reliability and fault tolerance of the server during execution engine initialization by returning an error instead of panicking when the orchestrator fails to start.
Problem
In
internal/orchestration/engine.go,StartEngine()handled orchestrator startup failures by logging and immediately executingpanic("Could not start execution engine"). In production or managed daemon environments, panicking causes an ungraceful crash with an unhandled stack dump rather than allowing the server supervisor to catch the error, log structured diagnostics, and perform an orderly exit.Changes
internal/orchestration/engine.go: UpdatedStartEngine()signature to returnerror. Replacedpanic()with returning the orchestrator startup error, and returnednilwhen no orchestrator backend is configured or upon successful startup.internal/app/app.go: UpdatedNewServices(...)signature to return(*Services, error), propagating the error ifexecutionEngine.StartEngine()fails.cmd/airavata-server/main.go: Handled the error returned byapp.NewServices(...), returningfmt.Errorf("build services: %w", err)to allowrunServer()andmain()to log the failure cleanly and exit with code 1.internal/server/server_test.go: UpdatednewHarnessto handle the(svcs, err)return signature fromapp.NewServices(...).Verification
NewServicesandStartEngineacross the repository to ensure all callers (cmd/airavata-serverandinternal/server/server_test.go) correctly handle errors.