Skip to content

Remove generic rescues to let errors bubble up - #10

Merged
maboelnour merged 7 commits into
masterfrom
remove-unnecessary-rescues
Jul 29, 2026
Merged

Remove generic rescues to let errors bubble up#10
maboelnour merged 7 commits into
masterfrom
remove-unnecessary-rescues

Conversation

@maboelnour

@maboelnour maboelnour commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

The generic rescue => e; raise NetworkError in get_service and scale_out relabelled
every failure as "Could not find resource", which was misleading.

Removing the rescues lets errors bubble up as themselves and terminate the process, so the
failure is visible.

Each error is then classified as fatal or recoverable, so only the ones worth retrying are.
ConfigurationError is no longer an ApplicationError — previously the runner caught it
and retried on every tick, forever. The full breakdown is now documented in the README
under Error handling.

Two other swallows are fixed along the way: the New Relic client turned any failure into a
NaN metric, which compared false against both thresholds and made an outage look like a
healthy steady state; and the Kubernetes read and patch calls, left unhandled by removing
the rescues, are now mapped by status.

Removed unnecessary begin-rescue blocks for service retrieval and scaling.
@maboelnour
maboelnour requested a review from hammady July 28, 2026 11:38
@coveralls

coveralls commented Jul 28, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 78.9% (+5.7%) from 73.181% — remove-unnecessary-rescues into master

@maboelnour

Copy link
Copy Markdown
Collaborator Author

Version should be bumped.

@hammady
hammady self-requested a review July 28, 2026 16:33

@hammady hammady left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Please review all Application errors.

Comment thread lib/scaltainer/service_types/worker.rb
@maboelnour
maboelnour merged commit f76664c into master Jul 29, 2026
5 checks passed
@hammady
hammady deleted the remove-unnecessary-rescues branch July 30, 2026 17:26
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.

3 participants