Refuse a colliding rule change without naming a cause
A rule change whose lock wait times out answered "Another entitlement set change is in progress. Try again." The wait can be behind a conferral, a move or a tier change as well as another rule change, so the sentence named a cause the console cannot know. It now answers "Another change collided with this one; try again.", the sentence the plan acts will use for a lock wait or a deadlock (#187). The plan-act handlers still carry the old sentence, and so does their golden; they change when those handlers are rewritten.
This commit is contained in:
@@ -90,7 +90,7 @@ const (
|
||||
const (
|
||||
MessageInactiveRule = "That rule is no longer active."
|
||||
MessageAlreadyApplied = "Already applied."
|
||||
MessageInProgress = "Another entitlement set change is in progress. Try again."
|
||||
MessageInProgress = "Another change collided with this one; try again."
|
||||
MessagePopulation = "The pools carrying this set could not be listed. Try again."
|
||||
)
|
||||
|
||||
|
||||
@@ -487,7 +487,7 @@ func TestRuleChangeCommitsSerializeOnRendezvous(t *testing.T) {
|
||||
t.Fatalf("second commit error = %v, want a refusal", err)
|
||||
}
|
||||
if refusal.Kind != entitlements.RefusalInProgress ||
|
||||
refusal.Message != "Another entitlement set change is in progress. Try again." {
|
||||
refusal.Message != "Another change collided with this one; try again." {
|
||||
t.Errorf("refusal = %q (%s), want the in-progress sentence", refusal.Message, refusal.Kind)
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ Each numbered section below is one commit, and its items are that commit's parts
|
||||
- [x] 2.1 End `ListOrganizationsByType` (`internal/organization/queries/organizations.sql`) with `ORDER BY name, org_id`, regenerate sqlc, and add a test with two organizations of one name that pins their order. No golden moves (the fixtures' names are distinct); the commit says so after running the suite.
|
||||
- [x] 2.2 `PollEntitlementRecompute` (`internal/workflows/entitlements/recompute_drain_workflow.go`) logs a failed `ListChangesOwingRecomputeActivity` and goes on to its sleep and continue-as-new instead of returning the error, because Temporal's five retries end after about fifteen seconds and nothing restarts a failed poller. Test with the Temporal test suite: the list activity fails on every attempt, and the poller ends with a continue-as-new error, not the activity's.
|
||||
- [x] 2.3 The `entitlement-set-history` delta corrects the drain-selection sentence to the dead-letter behaviour. Add a database test beside `TestSettleObligationOnSettledObligationWritesNothing` that a `failed` obligation is not returned by `ListPendingObligations` and is returned after `RequeueFailedObligations`.
|
||||
- [ ] 2.4 Change `MessageInProgress` (`internal/entitlements/rule_change.go:93`) to "Another change collided with this one; try again." and the literal in `internal/entitlements/rule_change_test.go:490`; the other tests compare the constant. The `entitlements` and `entitlement-set-management` deltas carry the sentence. No golden moves: the plan-act goldens' copy of the old sentence comes from the plan-act handlers, which change in tasks 4 to 8.
|
||||
- [x] 2.4 Change `MessageInProgress` (`internal/entitlements/rule_change.go:93`) to "Another change collided with this one; try again." and the literal in `internal/entitlements/rule_change_test.go:490`; the other tests compare the constant. The `entitlements` and `entitlement-set-management` deltas carry the sentence. No golden moves: the plan-act goldens' copy of the old sentence comes from the plan-act handlers, which change in tasks 4 to 8.
|
||||
|
||||
## 3. One rule for an outgoing default and a pool's class
|
||||
|
||||
|
||||
Reference in New Issue
Block a user