static void* rpc_thread(void* arg) { CallData* cd = NULL; bool ok = true; while ( cq->Next(reinterpret_cast<void**>(&cd), &ok) ) { if( ok ) { cd->Proceed(); } else { // TODO: } } return NULL; }
I'm using several threads in the server side to process client request, the thread code is like above. When I'm only using one thread, everything is ok, but when I start more than one threads, the issue begin to occur. 在 2017年1月14日星期六 UTC+8下午3:25:50,zhang...@gmail.com写道: > > I'm writing an async grpc server, but after call FinishWithError some > times, it causes an assertion failure and abort. > stack trace as below. > > >> E0114 15:19:50.962619342 25405 server.cc:485] assertion >> failed: GRPC_CALL_OK == result >> Program received signal SIGABRT, Aborted. >> 0x00007ffff60705f7 in raise () from /lib64/libc.so.6 >> (gdb) bt >> #0 0x00007ffff60705f7 in raise () from /lib64/libc.so.6 >> #1 0x00007ffff6071ce8 in abort () from /lib64/libc.so.6 >> #2 0x00007ffff752bd13 in >> grpc::Server::PerformOpsOnCall(grpc::CallOpSetInterface*, grpc::Call*) () >> from /usr/local/src/grpc/libs/opt/libgrpc++.so.1 >> #3 0x0000000000459c7d in grpc::Call::PerformOps (this=0x7fffdc13fce0, >> ops=0x7fffdc13fd50) >> at /usr/local/src/grpc/include/grpc++/impl/codegen/call.h:662 >> #4 0x000000000045c82d in >> grpc::ServerAsyncResponseWriter<test::Response>::FinishWithError >> (this=0x7fffdc13fcd8, >> status=..., tag=0x7fffdc13fad0) at >> /usr/local/src/grpc/include/grpc++/impl/codegen/async_unary_call.h:168 > > > -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscr...@googlegroups.com. To post to this group, send email to grpc-io@googlegroups.com. Visit this group at https://groups.google.com/group/grpc-io. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/cd45b24f-55a8-4f6c-b22d-7813d0450811%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.