go-zero
go-zero copied to clipboard
mongo logDuration, context canceled occurred sometimes.
Describe the bug
版本gz1.6.0,go1.20
任何增删改查都有概率触发这个错误
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
Any addition, deletion, modification or query may trigger this error.
The go-zero documentation regarding the setting of the MongoDB operation timeout. https://go-zero.dev/docs/tutorials/mongo/connection
@codeErrorSleep 貌似不生效呢,我检查了传入mongo的context,超时时间是跟着gozero的设置走的,我这里设置了30s, 但是触发报错时,只用了100ms
Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
@codeErrorSleep doesn't seem to take effect. I checked the context passed into mongo. The timeout follows the setting of gozero. I set it here to 30s. But when the error is triggered, it only takes 100ms.
The clients might canceled the requests.