Skip to content

the server does not handle empty request message properly #33

@mw66

Description

@mw66

If we send a request, with empty message: e.g.

https://github.com/huntlabs/grpc-dlang/blob/master/examples/SimpleDemo/source/client.d#L15

comment out this line

  // request.name = "Hunt";

Then the server side will fail this test:

if(_incomingData.length > 0) {

and be trapped here forever:

warning("The data is not ready yet.");

and complains:

2022-10-17 02:24:04 | 8291 | warning | onData | The data is not ready yet. | /.dub/packages/grpc-0.5.0-beta.2/grpc/source/grpc/GrpcStream.d:148

and never pass the request to the handler.

On the client side, will see error like this:

2022-10-17 02:43:19 | 11773 | debug | remove | hunt.concurrency.ScheduledThreadPoolExecutor.ScheduledFutureTask!void.ScheduledFutureTask[Cancelled] | /.dub/packages/hunt-extra-1.2.3/hunt-
extra/source/hunt/concurrency/ScheduledThreadPoolExecutor.d:1129       

You can also try using Empty message to see this bug on the server side:

google/protobuf/empty.proto
or

message Empty {}

I even tried:

message NumberMsg {
  int64 value = 1;  // return number
}

  // on the client side:
  NumberMsg req = new NumberMsg();
  // but do not assign anything to req.value, the server side show the same bug.

I think we should fix this bug to handle empty message (e.g. empty string) properly.

Thanks.

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