-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
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:
grpc-dlang/source/grpc/GrpcStream.d
Line 141 in 662427b
| if(_incomingData.length > 0) { |
and be trapped here forever:
grpc-dlang/source/grpc/GrpcStream.d
Line 148 in 662427b
| 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
Labels
No labels