Skip to content

"RESOURCE_EXHAUSTED: gRPC message exceeds maximum size" on too many consecutive requests with Spring #68

@Equiphract

Description

@Equiphract

I have a simple Spring application that sends SQL statements to an ImmuDB instance running inside a Docker container.

Up to five such statements can be sent successfully, the sixth however causes the following exception:

io.grpc.StatusRuntimeException: RESOURCE_EXHAUSTED: gRPC message exceeds maximum size 4194304: 9502720

This is caused by a call to ImmuClient::commitTransaction. It seems like those multiple calls add up somehow. When I, instead of an SQL statement, just send a key-value pair I am able to send a few more requests but it ultimately crashes anyways at a certain point.

To make sure that this is not coding issue on my side, here is the method body that handles the request and makes use of the ImmuClient instance:

client.openSession("defaultdb", "immudb", "immudb");
try {
    client.beginTransaction();
    client.sqlExec(
        "insert into demo_table (message) values (?);",
        new SQLValue("some message")
    );
    client.commitTransaction();
} finally {
    client.closeSession();
}

Here is the instantiation of the ImmuClient object that is used in the above code extract as client:

@Bean
ImmuClient immuClient() {
    return ImmuClient.newBuilder()
        .withServerUrl("localhost")
        .withServerPort(3322)
        .build();
}

Do you have a clue what is happening here? Might this be a bug with immudb4j or is it a layer 8 problem?

I now did some more testing and tested the same piece of code as above in a plain Java project (no Spring) and I could not reproduce the exception.

Also, when writing key-value values instead of SQL statements to ImmuDB it sometimes crashes with a different exception:
io.netty.handler.codec.http2.Http2Exception: Incomplete header block fragment.

Another thing: When I shut down the ImmuClient and reinitialise it with every request to ImmuDB the exceptions do not happen.

So as it seems these exceptions only appear when Spring is in use and the ImmuClient is the same instance inbetween multiple requests.

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