Repository navigation
Return 534 when a network restart fails on an unavailable resource - #14632
Open
bhouse-nexthop wants to merge 1 commit into
Open
bhouse-nexthop wants to merge 1 commit into
bhouse-nexthop wants to merge 1 commit into
Conversation
RestartNetworkCmd.execute() let ResourceUnavailableException, ConcurrentOperationException and InsufficientCapacityException reach the async job dispatcher, which logs them at ERROR as "Unexpected exception while executing" and fails the job with 530. RestartVPCCmd catches the same exceptions and maps them to ServerApiException, so a refused restartVPC fails with 534 and a WARN line. Catch them in RestartNetworkCmd the same way: 534 for ResourceUnavailableException, 530 for ConcurrentOperationException and 533 for InsufficientCapacityException, each with the exception message. Signed-off-by: Brad House <bhouse@nexthop.ai>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 4.22 #14632 +/- ##
============================================
- Coverage 18.32% 18.32% -0.01%
- Complexity 16644 16646 +2
============================================
Files 5939 5939
Lines 537768 537780 +12
Branches 65929 65929
============================================
- Hits 98551 98547 -4
- Misses 428008 428029 +21
+ Partials 11209 11204 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Collaborator
Author
Test report: restartNetwork refused because the router's host is DisconnectedSummary: Environment
Steps
Results
Result: pass. Not covered: the |
This branch has not been deployed
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.
Description
This PR makes
restartNetworkreport a failed restart the wayrestartVPCdoes.RestartNetworkCmd.execute()letResourceUnavailableException,ConcurrentOperationExceptionandInsufficientCapacityExceptionreach the async job dispatcher. The dispatcher logs those at ERROR asUnexpected exception while executing ... RestartNetworkCmdand fails the job with 530.RestartVPCCmdcatches them and throws aServerApiExceptioninstead.RestartNetworkCmd.execute()now catches them in the same way, with the same logging:ResourceUnavailableException: error code 534 (RESOURCE_UNAVAILABLE_ERROR), logged at WARN;ConcurrentOperationException: 530 (INTERNAL_ERROR), logged at WARN;InsufficientCapacityException: 533 (INSUFFICIENT_CAPACITY_ERROR).The error text is the exception message in each case, as before. A restart that returns
falsestill fails with 530 andFailed to restart network.Fixes: #14631
Types of changes
Feature/Enhancement Scale or Bug Severity
Bug Severity
How Has This Been Tested?
RestartNetworkCmdTest(mvn -pl api -am test -Dtest=RestartNetworkCmdTest), 5 tests, all pass: success response;falsefrom the service gives 530; each of the three exceptions gives the error code listed above with the exception message.restartNetworkfailed with 530 and an ERROR stack trace, while the matchingrestartVPCfailed with 534 and a WARN line. This change has not been run in that lab; the behaviour is covered by the unit tests.How did you try to break this feature and the system with this change?
Checked that nothing else calls
RestartNetworkCmd.execute()and relies on the checked exceptions it declared; the API dispatcher is the only caller.