fix(worker): UnAdvise evicts the item's cached value (#238)
ci / windows-x86 (push) Successful in 1m51s
ci / java (push) Failing after 7m13s
ci / portable (push) Failing after 14m3s
ci / windows-x86 (push) Successful in 1m51s
ci / java (push) Failing after 7m13s
ci / portable (push) Failing after 14m3s
The live repro showed the value a ReadBulk's temporary advice on a caller's added-only item captured surviving the UnAdvise, so after the caller advised the item ReadBulk answered was_cached=true with that value before the caller's own first OnDataChange. The same staleness applied to any client UnAdvise followed by a re-advise. Drop the entry on UnAdvise; the item stays added.
This commit is contained in:
@@ -746,7 +746,13 @@ the handle they receive when the registry does not already track it. An
|
||||
`Unregister` ran is dispatched after the eviction and recreates the entry;
|
||||
when MXAccess later reuses that item id, `ReadBulk`'s cached path would
|
||||
otherwise serve the stale value as `was_cached = true`. A handle the
|
||||
registry still tracks belongs to a live item, so its entries are kept. Failed advice and cleanup calls
|
||||
registry still tracks belongs to a live item, so its entries are kept.
|
||||
Successful `UnAdvise` drops the handle pair's `MxAccessValueCache` entry too:
|
||||
the item stays added, but its value stops updating, so without the eviction a
|
||||
later re-advise would let `ReadBulk`'s cached path answer with the previous
|
||||
advice's value (for example the value a `ReadBulk`'s own temporary advice on a
|
||||
caller's added-only item captured) before the new advice's first
|
||||
`OnDataChange` lands. Failed advice and cleanup calls
|
||||
leave registry state unchanged so diagnostics continue to reflect the last
|
||||
successful MXAccess-owned state transition.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user