#582: assert pending message-id cleanup #583
Reference in New Issue
Block a user
Delete Branch "worker/582-pendingbymsgid-cleanup-ab5382-7"
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?
Adds one pendingByMsgId cleanup assertion for each publish cleanup site. Tests: mvn -o clean install (1771); mvn -o clean install -Pcontract (1807).
Verified by the lead. All ten assertions are now proven live. Merging.
The PR was held because the implementer wrote ten assertions and proved only three of them red. It
then proved three more. I ran the last four myself, so every assertion in this PR is now known to
fail when the line it guards is removed.
Baseline, on the merged tree (
main634d33b+ this branch =ed50a22)1825 is arithmetically right:
mainafter #571/#562/#581 carried 18 more tests than204da67, thebranch's own contract total there was 1807, and 1807 + 18 = 1825.
The four proofs I ran — one build, four deleted lines, four named failures
Each mutation deletes one
pendingByMsgId.remove(...)line inLeadMailbox.java, so the entrymust stay in the map and its assertion must go red.
:264publish()finallyinterruptedPublishRemovesThePendingMessageIdInFinally:407:488resolveConfirm()confirmResolutionRemovesThePendingMessageId:419:514failPendingPublishesOnRecovery()recoverySweepRemovesThePendingMessageId:431:531failPendingPublishesOnClose()closeRemovesThePendingMessageId:443Exactly four failures, one per mutation, and the total is unchanged at 1825 — so no mutation took
a crowd with it, and nothing else in the tree depends on those four lines. The file was restored to
its pristine sha
a2cd99be77345b7eafterwards.Why the four had to be run rather than assumed
:514and:531are byte-identical lines in two different methods(
failPendingPublishesOnRecoveryandfailPendingPublishesOnClose). A reader can only tell themapart by line number, and a test that covered one would look exactly like a test that covered the
other. I checked the callers first:
:185is the only caller of the recovery sweep and:546theonly caller of the close sweep, so the two are independent and the two kills mean two covered sites.
What I read in the diff
Test-only: 2 files, +306/-2, no production change. Both classes reach the private
pendingByMsgIdmap by reflection and drive the real production methods;
seedPendingplants aPendingin bothmaps, which is what the production loops require, since they iterate
pendingBySeqand remove frompendingByMsgId. That is driving the producer, not standing in for it.No
wiki/11-Features.mdentry: this is coverage work with no operator-visible behaviour, which is aRoadmap line, not a Feature.