You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Steps to reproduce:
In vendor/github.com/ydb-platform/ydb-go-sdk/v3/internal/query/session.go with func createSession when onDone is deferred, there is named returned variable passed to the function. If something goes wrong, the named variable is overwritten to nil and the tracer (ydb-go-sdk-otel in my case) calls *Session.ID() where *Session is already nil. In ydb-go-sdk-otel/internal/safe.ID(id id) func it's checked if the interface id is nil, but it isn't since the covered type is *Session == nil.
To reproduce the panic cancel context after deferred onDone before grpc call in createSession and run the code below.
Bug Report
YDB GO SDK version:
3.75.2
Environment
macOS Sonoma 14.2.1, amd64
Current behavior:
Expected behavior:
No panic.
Steps to reproduce:
In
vendor/github.com/ydb-platform/ydb-go-sdk/v3/internal/query/session.go
with funccreateSession
whenonDone
is deferred, there is named returned variable passed to the function. If something goes wrong, the named variable is overwritten to nil and the tracer (ydb-go-sdk-otel
in my case) calls*Session.ID()
where*Session
is already nil. Inydb-go-sdk-otel/internal/safe.ID(id id)
func it's checked if the interfaceid
is nil, but it isn't since the covered type is *Session == nil.To reproduce the panic cancel context after deferred
onDone
before grpc call increateSession
and run the code below.Related code:
createSession snippet:
Other information:
The text was updated successfully, but these errors were encountered: