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

The server write function context->gcc_writer->write() still return success, when the client had been killed #8

Open
lifeng68 opened this issue May 15, 2017 · 1 comment

Comments

@lifeng68
Copy link

lifeng68 commented May 15, 2017

@ajhai
Hello :
I started a streaming server for test. My .proto file descriped the grpc service as below, the 'events' RPC is a streaming RPC.
I started the event grpc client, and the server wrote the responses to the client. The client got the responses successfully. But when I killed the client with (kill -9 PID), the server still sent the responses successfully, the function context->gcc_writer->write() returned 0.
In my opinion, when i killed the client with (kill -9 PID), the server write function context->gcc_writer->write() should return fail. But now , it still return success, is this a bug? Is there any other ways to check the connections with the clients?

service ContainerService {
	rpc Create(CreateRequest) returns (CreateResponse);
        rpc Start(StartRequest) returns (StartResponse);
        rpc Kill(KillRequest) returns (KillResponse);
	rpc Delete(DeleteRequest) returns (DeleteResponse);
	rpc Info(InfoRequest) returns (InfoResponse);
	rpc List(ListRequest) returns (ListResponse);
	rpc Events(EventsRequest) returns (stream Event);
}
@ajhai
Copy link
Contributor

ajhai commented May 15, 2017

@lifeng68 I have pushed some changes over weekend. You can now use grpc_c_context_is_call_cancelled(context) from server to check if client has disconnected. Ideally writer_write should return fail. If it is not doing that, it is a bug. Let me test it and add some examples around streaming. Also, I'm making some more changes. Expect things to break. I will reply on this thread when once I test streaming server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants