[GODRIVER-3057] typeEncoderCache.LoadOrStore will panic when enc is nil Created: 27/Nov/23  Updated: 29/Nov/23  Resolved: 29/Nov/23

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: 1.13.0
Fix Version/s: None

Type: Bug Priority: Unknown
Reporter: x w Assignee: Qingyang Hu
Resolution: Duplicate Votes: 0
Labels: Bug
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates GODRIVER-3051 Panic when decoding is done concurrently Closed
Documentation Changes Summary:

1. What would you like to communicate to the user about this feature?
2. Would you like the user to see examples of the syntax and/or executable code and its output?
3. Which versions of the driver/connector does this apply to?


 Description   

Detailed steps to reproduce the problem?

Call typeEncoderCache.LoadOrStore twice will panic when enc is nil.

enc = v.(ValueEncoder) should be enc, _ = v.(ValueEncoder)


_func (c *typeEncoderCache) LoadOrStore(rt reflect.Type, enc ValueEncoder) ValueEncoder {
if v, loaded := c.cache.LoadOrStore(rt, enc); loaded

{ enc = v.(ValueEncoder) }

return enc
}_

 



 Comments   
Comment by PM Bot [ 27/Nov/23 ]

Hi wxblue@gmail.com, thank you for reporting this issue! The team will look into it and get back to you soon.

Generated at Thu Feb 08 08:39:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.