Skip to content

Commit

Permalink
Fix always reporting fail even on success
Browse files Browse the repository at this point in the history
Avoid false-positives like (notice lack of stacktrace logging too):
```
16:36:00,592 ERROR {} Ec2Instance(instanceId = i-080edd5933a74418f) failed to release itself
16:36:30,577 ERROR {} Ec2Instance(instanceId = i-061f9c1f94990848e) failed to release itself
```
  • Loading branch information
dagguh committed Jan 4, 2024
1 parent e771873 commit 970680d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Dropping a requirement of a major version of a dependency is a new contract.
- Add missing `iam:GetRole` permission. You have to update the policy manually. Fix [JPERF-1407].
- Reduce pressure on CloudFormation when cleaning long lists of expired stacks. Help [JPERF-1332].
- Clean up EC2 security groups before CloudFormation stacks. Fix [JPERF-1208].
- Fix housekeeping fail logging.

[JPERF-1407]: https://ecosystem.atlassian.net/browse/JPERF-1407
[JPERF-1332]: https://ecosystem.atlassian.net/browse/JPERF-1332
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ConcurrentHousekeeping(
if (!resource.isExpired()) {
throw Exception("You can't release $resource. It hasn't expired.")
}
return resource.release().handle { throwable, _ ->
return resource.release().handle { _, throwable: Throwable? ->
if (throwable != null) {
logger.error("$resource failed to release itself", throwable)
}
Expand Down

0 comments on commit 970680d

Please sign in to comment.