Skip to content

Conversation

@mattygiedt
Copy link

Moves the CallbackService class 'up' into the main gRPC Service class

Currently, if the --grpc-callback-api flag is passed to flatc, the $SERVICE$::CallbackService class is defined outside the main $SERVICE$ class. gcc (maybe others?) does not like the generated .grpc.fb.h file.

This PR moves the callback class 'up' into the main $SERVICE$ class.

Moves the CallbackService class 'up' into the main gRPC Service class
@mattygiedt
Copy link
Author

mattygiedt commented Oct 16, 2025

I actually think there's more to do here in order to use the various grpc Reactors. Trying to use a simple ServerUrnaryReactor I get the following segmentation fault:

gRPC version: 1.59.5

(gdb) bt
#0  0x000000000060535e in grpc::internal::CallbackUnaryHandler<flatbuffers::grpc::Message<CommandRequest>, flatbuffers::grpc::Message<CommandResponse> >::Deserialize (this=0x1b262d0, call=0x1bfe070, req=0x1bf3400, 
    status=0x1b5c0a0, handler_data=0x0) at /usr/local/include/grpcpp/impl/server_callback_handlers.h:94
#1  0x00000000009512cc in grpc::Server::SyncRequestThreadManager::DoWork(void*, bool, bool) ()
#2  0x00000000009561f0 in grpc::ThreadManager::MainWorkLoop() ()
#3  0x000000000095638c in grpc::ThreadManager::WorkerThread::Run() ()
#4  0x0000000000e71ac3 in grpc_core::(anonymous namespace)::ThreadInternalsPosix::ThreadInternalsPosix(char const*, void (*)(void*), void*, bool*, grpc_core::Thread::Options const&)::{lambda(void*)#1}::_FUN(void*) ()

Unclear on next steps, and / or if the builder_.SetContextAllocator interface will give us what we need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant