Skip to content

server abort on client exit #1

@sergio-vedois

Description

@sergio-vedois

Hi Mr.;

I have downloaded your example (https://github.com/DinoStray/grpc_example_async_cpp_api), compiled and ran.
It was very helpful to me to understand how an grpc async server and client works using stream Messages.
Then I started making some tests.
One was to change the sleep value in both server (thread_publish_greeting) and client (thread_for_request).
The value used was ( 1ms - std::this_thread::sleep_for(std::chrono::milliseconds(1)); ).
I know I shouldn't do it, but it is just a test.
Well .... I started the server and 4 clients and let it run for a while .
Everything went normal until I closed (ctrl-c) one of the clients.
The server went down (abort) accessing the method:

completion_queue_call_->Next(reinterpret_cast<void **>(&session_id), &ok);

In completion_queue_impl.h, method:

bool Next(void** tag, bool* ok) {
return (AsyncNextInternal(tag, ok,
::grpc::g_core_codegen_interface->gpr_inf_future(
GPR_CLOCK_REALTIME)) != SHUTDOWN);
}

I tryied to put in a try->catch, but with no success.
The idea is just prevent the server to go down.

It would be very helpfull If you could help me.
thanks a lot.

Sérgio Andrade

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions