GODRIVER-3056 fix panic on type conversion of nil val in bson codec_cache #1478
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
GODRIVER-3056
(
i created an issue in the jira but it vanished never to be found again- also for a opensource project hosted in github it is a bit of a stretch to login to yet another server just to file an issue)Summary
v1.13.0 (in fact v1.12.2 also) introduces panics and hence a breaking change with the bson codec_cache
below is stack trace from the system that encountered issue - and it is confirmed that v1.12.1 does not have this issue which i re tested by reverting the version back.
Stack trace:
for some reason the cache returned nil as value with true as loaded flag but this is buggy.
Background & Motivation
the issue is noticed in
LoadOrStore()but not inLoad()and i am sure they both need to work similarly. Load() already checks if the value itself is nil or not but LoadOrStore doesn't, this PR fixes that