AlarmAckWriter: write-completion cache keeps entries for dropped item handles #165
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
After an ack ends
Unconfirmed,AlarmAckWritermarks the itemDirty(src/ZB.MOM.WW.MxGateway.Worker/MxAccess/AlarmAckWriter.cs:215). The next ack then drops and re-adds the item to get a fresh handle (:151). LRU eviction andTearDownServerdrop handles too.Problem:
MxAccessWriteCompletionCache(src/ZB.MOM.WW.MxGateway.Worker/MxAccess/MxAccessWriteCompletionCache.cs) keeps its(serverHandle, itemHandle)entry for every dropped handle; nothing removes it. The cache grows slowly for the life of the worker, by one entry per unconfirmed ack and per evicted item.Suggested fix: add a
Remove(serverHandle, itemHandle)(and a clear-by-server for teardown) toMxAccessWriteCompletionCache. Call it fromAlarmAckWriter's drop, evict and teardown paths. Add a unit test that the entry count returns to baseline after a dirty re-add and after an eviction.Found in the final review of PR #162 (feat/ackmsg-as-operator); left unfixed by decision as Minor.
https://claude.ai/code/session_016J6isfcgqy4SB2RK3ZvFvT
Fixed on feat/ackmsg-as-operator (PR #162) in
f13950e+463748e. MxAccessWriteCompletionCache gained Remove/RemoveServer/Count; the writer removes entries on dirty re-add, eviction, failed add/advise/write and teardown, and ignores late OnWriteComplete events for handles it no longer holds (so they can't recreate an entry). Tests cover each path. windev Worker.Tests 585/0. Closes when PR #162 merges.https://claude.ai/code/session_016J6isfcgqy4SB2RK3ZvFvT