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

fix(exceptions): Don't let errors in trackResult leak out #3843

Merged
merged 2 commits into from
Aug 6, 2020

Conversation

marchello2000
Copy link
Contributor

It's possible for trackResult metrics call to fail and we don't want that failure to leak out and fail orca tasks

It's possible for trackResult metrics call to fail and we don't want that failure to leak out and fail orca tasks
@@ -58,9 +58,12 @@ default String getCredentials(Map<String, Object> context) {

// may return a list with 0, 1 or more regions (no guarantees on the ordering)
default List<String> getRegions(Map<String, Object> context) {
String region = (String) context.getOrDefault("region", null);
Object region = context.getOrDefault("region", null);
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 sometimes is a string and sometimes a list. I tried to make it handle both. but also wrapped in try/catch in the other files

@@ -169,7 +170,7 @@ class RunTaskHandler(
} else if (e is TimeoutException && stage.context["markSuccessfulOnTimeout"] == true) {
queue.push(CompleteTask(message, SUCCEEDED))
} else {
if (e !is TimeoutException) {
if (e !is TimeoutException && e !is UserException) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh, this is actually from a related but separate change. but might as well go together. Basically, we shouldn't log errors for exceptiosn that are not in "our" control. E.g. bad SpEL expression and any other UserExceptions

@marchello2000 marchello2000 added the ready to merge Approved and ready for merge label Aug 6, 2020
@mergify mergify bot added the auto merged Merged automatically by a bot label Aug 6, 2020
@mergify mergify bot merged commit 9aa0b3c into spinnaker:master Aug 6, 2020
@marchello2000 marchello2000 deleted the mark/radar_trackresult branch August 27, 2020 18:31
KathrynLewis pushed a commit to KathrynLewis/orca that referenced this pull request Jan 31, 2021
…r#3843)

It's possible for trackResult metrics call to fail and we don't want that failure to leak out and fail orca tasks

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto merged Merged automatically by a bot ready to merge Approved and ready for merge target-release/1.22
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants