CB-590 follow-up: per-source reminder budgets for the push loop #90
Reference in New Issue
Block a user
Delete Branch "worker/cb590fix-185e9a-10"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes the regression a reviewer found in PR #84: collapsing the CB-307 (reply) and CB-588 (ticket) nudge schedules into one per lead also collapsed them onto one shared reminderCount. A reply stream that exhausted its own budget could then make decide() STOP even when a ticket for the same lead had coalesced onto the still-active schedule and had never been nudged - stranding it, since stopOrRestart cannot rescue work already present in that tick's "before" snapshot.
Fix: decide(lead, replyReminderCount, ticketReminderCount) tracks each source's budget independently. INJECT fires while either source is still under its own cap; STOP only when both are exhausted. Still exactly one schedule per lead - stopOrRestart's snapshot-diff race guard is untouched.
Also adds the reply-arm mirror of the existing stopOrRestart race/stale tests (only the ticket arm was pinned before), and a direct regression test for the cross-source case (oneExhaustedSourceDoesNotBlockANudgeForTheOtherSource) that fails against the pre-fix shared-counter behavior - verified locally by temporarily reverting decide() to a shared-counter simulation: it failed with expected INJECT but was STOP.
mvn clean install: Tests run: 814, Failures: 0, Errors: 0 - BUILD SUCCESS. ReplyPushLoopTest: Tests run: 41, Failures: 0.