[GODRIVER-3056] v1.13.0 introduces panics and thus breaking change  Created: 22/Nov/23  Updated: 29/Nov/23  Resolved: 29/Nov/23

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

Type: Task Priority: Unknown
Reporter: Jitendra Adhikari Assignee: Qingyang Hu
Resolution: Duplicate Votes: 0
Labels: None
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   

Context

v1.13.0 introduces panics and thus breaking change, i reverted to v1.12.1 and it works normally again.
Error message is: `interface conversion: interface is nil, not bsoncodec.ValueEncoder`

location of panic: https://github.com/mongodb/mongo-go-driver/compare/v1.12.2...v1.13.0#diff-47bf0c01e00c33986c6fe19d7b1aaee2df975f5b2aad923a29f07192fda9cb05R45 

```
goroutine 292 [running]:
runtime/debug.Stack()
/usr/local/go/src/runtime/debug/stack.go:24 +0x5e
github.com/adhocore/module/web.errlogc(0xc00090a480, {0xc0004bdb58?, 0x1, 0xc000000b40?})
~/projects/my/module/web/helper.go:297 +0xcc
github.com/adhocore/module/web.errlog(0xc18500?, {0xc0004bdb58, 0x1, 0x1})
~/projects/my/module/web/helper.go:282 +0x39
github.com/adhocore/module/web.errorx(0xc000209800, {0x7f77785800b8?, 0xc000300390})
~/projects/my/module/web/helper.go:175 +0x66e
github.com/adhocore/module/web.bootstrap.func2(0x10?, {0xc17300?, 0xc000300390?})
~/projects/my/module/web/app.go:150 +0x3e
github.com/adhocore/module/web.bootstrap.New.func3.1()
~/go/pkg/mod/github.com/gofiber/fiber/v2@v2.51.0/middleware/recover/recover.go:31 +0x72
panic({0xc17300?, 0xc000300390?})
/usr/local/go/src/runtime/panic.go:914 +0x21f
go.mongodb.org/mongo-driver/bson/bsoncodec.(*typeEncoderCache).LoadOrStore(...)
~/go/pkg/mod/go.mongodb.org/mongo-driver@v1.13.0/bson/bsoncodec/codec_cache.go:45
go.mongodb.org/mongo-driver/bson/bsoncodec.(*Registry).storeTypeEncoder(0xc00032e2a0?, {0xf48e88?, 0xc17100?}, {0x0, 0x0})
~/go/pkg/mod/go.mongodb.org/mongo-driver@v1.13.0/bson/bsoncodec/registry.go:416 +0x77
go.mongodb.org/mongo-driver/bson/bsoncodec.(*Registry).LookupEncoder(0xc00032e2a0, {0xf48e88, 0xc17100})
~/go/pkg/mod/go.mongodb.org/mongo-driver@v1.13.0/bson/bsoncodec/registry.go:411 +0x1fa
go.mongodb.org/mongo-driver/bson/bsoncodec.(*StructCodec).describeStructSlow(0xc0001db4c0, 0xcc0380?, {0xf48e88, 0xcce820}, 0x0, 0x0)
~/go/pkg/mod/go.mongodb.org/mongo-driver@v1.13.0/bson/bsoncodec/struct_codec.go:515 +0x225
go.mongodb.org/mongo-driver/bson/bsoncodec.(*StructCodec).describeStruct(0xc0001db4c0, 0x1c?, {0xf48e88?, 0xcce820}, 0x53?, 0x5c?)
~/go/pkg/mod/go.mongodb.org/mongo-driver@v1.13.0/bson/bsoncodec/struct_codec.go:483 +0x9a
go.mongodb.org/mongo-driver/bson/bsoncodec.(*StructCodec).DecodeValue(0xc0001db4c0, {0xc00032e2a0, 0x0,

{0x0, 0x0}, {0x0, 0x0}, 0x0, 0x0, 0x0, ...}, ...)
~/go/pkg/mod/go.mongodb.org/mongo-driver@v1.13.0/bson/bsoncodec/struct_codec.go:282 +0x111
go.mongodb.org/mongo-driver/bson/bsoncodec.(*PointerCodec).DecodeValue(0xc0001db500, {0xc00032e2a0, 0x0, {0x0, 0x0}

, {0x0, 0x0}, 0x0, 0x0, 0x0, ...}, ...)
~/go/pkg/mod/go.mongodb.org/mongo-driver@v1.13.0/bson/bsoncodec/pointer_codec.go:91 +0x2ab
go.mongodb.org/mongo-driver/bson.(*Decoder).Decode(0xc0006a00f0, {0xbc92a0, 0xc0003e8108})
~/go/pkg/mod/go.mongodb.org/mongo-driver@v1.13.0/bson/decoder.go:134 +0x3e3
go.mongodb.org/mongo-driver/mongo.(*Cursor).Decode(0x7f777857e6b0?, {0xbc92a0, 0xc0003e8108})
~/go/pkg/mod/go.mongodb.org/mongo-driver@v1.13.0/mongo/cursor.go:275 +0x8e
github.com/adhocore/module/model.(*Scrip).fromCursor(0xc00035e1c0, 0xf40328?)
~/projects/my/module/model/scrip.go:150 +0x6b
github.com/adhocore/module/model.(*Stocks).loadScrips(0xc000aaac60, 0x0, {0x0, 0x0, 0x0})
~/projects/my/module/model/stocks.go:234 +0x2a9
```

Definition of done

What must be done to consider the task complete?

Pitfalls

What should the implementer watch out for? What are the risks?



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

Hi jiten.adhikary@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.