Skip to content

bug: Unreadable error when context deadline is exceeded in ydb.Open #1926

@kprokopenko

Description

@kprokopenko

Bug Report

YDB GO SDK version:

v3.118.0

Environment

All environments

Current behavior:

When the context passed to ydb.Open has its deadline exceeded, an error message is displayed that is difficult to understand. This makes it challenging to diagnose and resolve the issue.

Expected behavior:

Error something like: context deadline exceeded at Open(driver.go:XXX)

Steps to reproduce:

  1. Create a context with a deadline that has already been exceeded.
  2. Pass this context to the ydb.Open function.
  3. Observe the error message that is returned.
func TestOpen(t *testing.T) {
	ctx, cancel := context.WithTimeout(context.Background(), 1*time.Nanosecond)
	defer cancel()

	time.Sleep(10 * time.Nanosecond)

	_, err := ydb.Open(ctx, "grpc://localhost:2136/local")
	require.NoError(t, err)
}
Error:          Received unexpected error:
                                retry failed on attempt No.1: context deadline exceeded at `github.com/ydb-platform/ydb-go-sdk/v3/retry.RetryWithResult(retry.go:337)` at `github.com/ydb-platform/ydb-go-sdk/v3/retry.Retry(retry.go:270)` at `github.com/ydb-platform/ydb-go-sdk/v3/internal/balancer.New(balancer.go:322)` at `github.com/ydb-platform/ydb-go-sdk/v3.(*Driver).connect(driver.go:458)` at `github.com/ydb-platform/ydb-go-sdk/v3.Open(driver.go:314)`

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions