| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…ntryWrapper The flag was never cleared on recycle, so any wrapper that had served a cache hit kept messageMetadataInitialized=true for every entry it was later reused for. getValueInternal then skipped the lazy initializeMessageMetadataIfNeeded call, and cache hits returned entries with null metadata, forcing each dispatcher to re-parse the message metadata per entry per subscription.
| Back | FazBrowse Home | New Git URL |
Motivation
RangeCacheEntryWrapper.recycle() resets all wrapper fields except messageMetadataInitialized. Once a wrapper has served a cache hit (which sets the flag in getValueInternal), every entry later stored in that recycled wrapper instance inherits messageMetadataInitialized=true, so getValueInternal() skips the lazy EntryImpl.initializeMessageMetadataIfNeeded() call.
After recycler warm-up, cache hits return entries whose message metadata was never parsed, and each dispatcher falls back to Commands.peekAndCopyMessageMetadata — a full metadata parse plus a MessageMetadata copy per entry per subscription. This silently defeats the parse-once-per-cached-entry optimization, with the cost multiplied by subscription fan-out.
Modifications
Reset messageMetadataInitialized in recycle(), matching the reset of the other wrapper fields. recycle() is the wrapper's only return-to-pool path, so this fully restores the intended lazy-init behavior.