polish(creacc): drop dead transient-failure path (#14)#45
Merged
Conversation
After replacing the COBOL ENQ/DEQ with SELECT ... FOR UPDATE on control, the CreaccResult.isTransientFailure() predicate (and the CreaccController 503 mapping that consumed it) became unreachable. CreaccService and CreaccRepository only emit fail codes A, 1, 8, 9, and 7 (rollback) - never 3 or 5. Drop the dead predicate and the unused TRANSIENT_FAIL_CODES constant, and remove the matching 503 branch from CreaccController#failureStatus. Counter / lock contention is already either retried by CrdbRetry on 40001 or surfaced as CbsaAbendException -> 500.
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.
Closes #14.
Why
Issue #14 asked us to decide whether
CreaccResult.isTransientFailure()(and the matching
503 SERVICE_UNAVAILABLEmapping inCreaccController#failureStatus) is dead code now that the COBOLENQ/DEQ around the account-counter row has been replaced with
SELECT ... FOR UPDATEoncontrol.Audit of every fail-code emission in CREACC:
CreaccService.create(...)emits"A"(validation),"1"(customernot found),
"9"(account-count fetch failed), and"8"(capacityreached).
CreaccRepositoryonly emits"7"viarollbackFailure(...)for anaccount-insert rollback.
CrdbRetryretries40001serialization failures, and anysurviving
DataAccessExceptionis wrapped into aCbsaAbendExceptionand surfaced as500/UNEXvia the globalhandler.
Nothing in the CREACC path produces fail codes
"3"or"5", so theisTransientFailure()predicate and its503mapping are unreachable.What
TRANSIENT_FAIL_CODESand theisTransientFailure()predicatefrom
CreaccResult.if (result.isTransientFailure()) ... 503branch fromCreaccController#failureStatus.If transient counter-lock errors ever do need a domain-level fail
code in the future, they can be reintroduced as a fresh predicate
plus an explicit emission site, rather than being kept as silently
dead code.
Tests
No behaviour change for any reachable code path.
./mvnw verify:205/205 green locally (no test-suite changes required).
augment review