Skip to content

Cannot create session, code: OVERLOADED #17

@alex-dorokhov

Description

@alex-dorokhov

I'm running a cloud function every minute. Periodically I'm getting the following error while trying to get a db session. I'm closing a session at the end of the handler by calling close().await(), but still it does not help.

Caused by: com.yandex.ydb.core.UnexpectedResultException: cannot create session, code: OVERLOADED, issues: [Active sessions limit exceeded, maximum allowed: 1000 (S_ERROR)]
	at com.yandex.ydb.core.Result$Fail.newException(Result.java:217)
	at com.yandex.ydb.core.Result$Fail.expect(Result.java:169)
	at com.yandex.ydb.table.impl.SessionPool.lambda$create$0(SessionPool.java:57)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:642)
	... 22 more

This is how I create the client:

TableClient
            .newClient(GrpcTableRpc.useTransport(transport))
            .build()

And I switched to this recently (but the error is still there):

TableClient
            .newClient(GrpcTableRpc.useTransport(transport))
            .sessionPoolSize(0, 10)
            .sessionMaxIdleTime(Duration.of(120, ChronoUnit.SECONDS))
            .build()

What could be wrong?

The version is 1.10.3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions