Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: ydb.New() freezes on Windows #40

Closed
ArtemSBulgakov opened this issue Nov 3, 2021 · 2 comments
Closed

bug: ydb.New() freezes on Windows #40

ArtemSBulgakov opened this issue Nov 3, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@ArtemSBulgakov
Copy link

ArtemSBulgakov commented Nov 3, 2021

Bug Report

YDB GO SDK version:

v3.2.7

Environment

Windows 10

go version go1.17.2 windows/amd64

Current behavior:

When trying to create new connection with ydb.New(...), program freezes.

Expected behavior:

It should create new connection and continue program.

Steps to reproduce:

package main

import (
	"context"
	"log"
	"os"
	"time"

	"github.com/ydb-platform/ydb-go-sdk/v3"
	"github.com/ydb-platform/ydb-go-sdk/v3/config"
	yc "github.com/ydb-platform/ydb-go-yc"
)

func main() {
	ctx := context.Background()
	log.Println("1")
	db, err := ydb.New(
		ctx,
		ydb.WithConnectionString(os.Getenv("YDB_CONNECTION_STRING")),
		ydb.WithDialTimeout(5*time.Second),
		ydb.WithBalancingConfig(config.BalancerConfig{
			Algorithm:   config.BalancingAlgorithmRandomChoice,
			PreferLocal: false,
		}),
		yc.WithServiceAccountKeyFileCredentials(
			"sa.json",
			yc.WithDefaultEndpoint(),
			yc.WithInsecureSkipVerify(true),
		),
		ydb.WithSessionPoolSizeLimit(300),
		ydb.WithSessionPoolIdleThreshold(time.Second*5),
		ydb.WithGrpcConnectionTTL(5*time.Second),
	)
	log.Println("2")
	if err != nil {
		panic(err)
	}
	defer func() {
		_ = db.Close(ctx)
	}()

	log.Printf("Database: %s", db.Name())
}

Related code:

Output:

2021/11/03 16:37:24 1

(it doesn't print 2 and doesn't return any error)

Other information:

Stacktrace when pausing program in debug mode in GoLand:

runtime.gopark at proc.go:337
runtime.selectgo at select.go:327
google.golang.org/grpc.(*ClientConn).WaitForStateChange at clientconn.go:508
google.golang.org/grpc.DialContext at clientconn.go:316
github.com/ydb-platform/ydb-go-sdk/v3/internal/dial.(*dialer).dial at dialer.go:78
github.com/ydb-platform/ydb-go-sdk/v3/internal/dial.(*dialer).dial-fm at dialer.go:77
github.com/ydb-platform/ydb-go-sdk/v3/internal/driver/cluster/balancer/conn.(*conn).take at conn.go:88
github.com/ydb-platform/ydb-go-sdk/v3/internal/driver/cluster/balancer/conn.(*conn).Invoke at conn.go:217
github.com/ydb-platform/ydb-go-genproto/Ydb_Discovery_V1.(*discoveryServiceClient).ListEndpoints at ydb_discovery_v1_grpc.pb.go:36
github.com/ydb-platform/ydb-go-sdk/v3/internal/discovery.(*client).Discover at discovery.go:61
github.com/ydb-platform/ydb-go-sdk/v3/internal/dial.(*dialer).discover at discovery.go:18
github.com/ydb-platform/ydb-go-sdk/v3/internal/dial.(*dialer).connect at dialer.go:63
github.com/ydb-platform/ydb-go-sdk/v3/internal/dial.Dial at dialer.go:37
github.com/ydb-platform/ydb-go-sdk/v3.New at connection.go:124
main.main at main.go:17
runtime.main at proc.go:225
runtime.goexit at asm_amd64.s:1371
 - Async Stack Trace
runtime.rt0_go at asm_amd64.s:226
@ArtemSBulgakov ArtemSBulgakov added the bug Something isn't working label Nov 3, 2021
@asmyasnikov
Copy link
Member

Hello, do you check bug on latest version of sdk on your windows system?

@ArtemSBulgakov
Copy link
Author

The bug is fixed, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants