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: Session leak on Table().Do() #1309

Open
rekby opened this issue Jun 25, 2024 · 0 comments
Open

bug: Session leak on Table().Do() #1309

rekby opened this issue Jun 25, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@rekby
Copy link
Member

rekby commented Jun 25, 2024

Bug Report

YDB GO SDK version: 3.74.7

Reproduced on local ydb.

Code:

Details
	ctx := context.Background()
	db := must(ydb.Open(
		ctx,
		connectionString,
		yc.WithInternalCA(),
		ydb.WithAccessTokenCredentials(internalOAuthToken),
		// yc.WithServiceAccountKeyFileCredentials(serviсeAccountFile),
		// ydb.WithDiscoveryInterval(time.Second),
		ydb.WithLogger(log.Default(os.Stderr), trace.DetailsAll),
	))

	for {
		readCtx, cancel := context.WithTimeout(ctx, time.Millisecond*10)
		_ = db.Table().Do(readCtx, func(ctx context.Context, s table.Session) error {
			_, res, err := s.Execute(ctx, table.SerializableReadWriteTxControl(table.CommitTx()), "SELECT 1", nil)
			if res != nil {
				res.Close()
			}
			switch {
			case err == nil:
				return nil
			case ydb.IsTransportError(err):
				return err
			case ctx.Err() != nil:
				return nil
			default:
				panic(err)
			}
		})
		cancel()
	}

Session leaks can see on diagnostics page:
http://localhost:8765/actors/kqp_proxy

Active session_actors count on node: 167

@rekby rekby added the bug Something isn't working label Jun 25, 2024
@rekby rekby changed the title bug: bug: Session leak on Table().Do() Jun 25, 2024
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

1 participant