gRPC::grpc
gRPC::grpc++
gRPC::grpc_plugin_support
I'm linking to these interfaces in my cmakelists
duplicate symbol '_google_protobuf_any_proto_upb_file_layout' in:
/Users/danem/Programming/cpp/grpc/install_default/lib/libgrpc.a(any.upb.c.o)
/Users/danem/Programming/cpp/grpc/install_default/lib/libgpr.a(any.upb.c.o)
duplicate symbol '_google_protobuf_Any_msginit' in:
/Users/danem/Programming/cpp/grpc/install_default/lib/libgrpc.a(any.upb.c.o)
/Users/danem/Programming/cpp/grpc/install_default/lib/libgpr.a(any.upb.c.o)
duplicate symbol '_google_rpc_status_proto_upb_file_layout' in:
/Users/danem/Programming/cpp/grpc/install_default/lib/libgrpc.a(status.upb.c.o)
/Users/danem/Programming/cpp/grpc/install_default/lib/libgpr.a(status.upb.c.o)
duplicate symbol '_google_rpc_Status_msginit' in:
/Users/danem/Programming/cpp/grpc/install_default/lib/libgrpc.a(status.upb.c.o)
/Users/danem/Programming/cpp/grpc/install_default/lib/libgpr.a(status.upb.c.o)
duplicate symbol '_google_protobuf_descriptor_proto_upb_file_layout' in:
/Users/danem/Programming/cpp/grpc/install_default/lib/libgrpc.a(descriptor.upb.c.o)
/Users/danem/Programming/cpp/grpc/install_default/lib/libupb.a(descriptor.upb.c.o)
find_package(Protobuf CONFIG REQUIRED)
find_package(absl CONFIG REQUIRED)
find_package(gRPC REQUIRED)
# ...
# ----------------------
# Protobuf + GRPC
# -----------------------
set(proto_dir "${CMAKE_CURRENT_SOURCE_DIR}/protobuf")
set(proto_inputs ...)
protobuf_generate(
LANGUAGE cpp
OUT_VAR PROTO_SRCS
PROTOS ${proto_inputs}
IMPORT_DIRS ${proto_dir}
)
add_library(my-app-proto-iface STATIC ${PROTO_SRCS})
target_link_libraries(my-app-proto-iface PUBLIC protobuf::libprotobuf)
grpc_generate_cpp(GRPC_SRCS GRPC_HDRS ${CMAKE_CURRENT_BINARY_DIR} "${proto_dir}/grpc-services.proto")
add_library(my-app-grpc-iface STATIC ${GRPC_SRCS} ${GRPC_HDRS})
target_link_libraries(my-app-grpc-iface PUBLIC
gRPC::grpc
gRPC::grpc++
gRPC::grpc_plugin_support
gRPC::grpc++_reflection
my-app-proto-iface
)
# ----------
# App Server
add_executable(my-app-server ...)
target_link_libraries(my-app-server PUBLIC
# ...
my-app-grpc-iface
)
cmake_minimum_required(VERSION 3.14)
set(CMAKE_CXX_STANDARD 17)
project(grpc-test)
find_package(Protobuf CONFIG REQUIRED)
find_package(absl CONFIG REQUIRED)
find_package(gRPC REQUIRED)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/SupportGRPC.cmake)
set(proto_dir "${CMAKE_CURRENT_SOURCE_DIR}/protobuf")
grpc_generate_cpp(GRPC_SRCS GRPC_HDRS ${CMAKE_CURRENT_BINARY_DIR}
"${proto_dir}/helloworld.proto"
)
add_executable(grpc-test
./src/main.cc
${GRPC_SRCS}
${GRPC_HDRS}
)
set(Protobuf_IMPORT_DIRS "${proto_dir}")
protobuf_generate(
LANGUAGE cpp
TARGET grpc-test
PROTOS "${proto_dir}/test.proto" "${proto_dir}/helloworld.proto"
IMPORT_DIRS ${Protobuf_IMPORT_DIRS}
)
target_include_directories(grpc-test PRIVATE
# HACK!
${CMAKE_CURRENT_BINARY_DIR}
)
target_link_libraries(grpc-test PRIVATE
gRPC::grpc
gRPC::grpc++
gRPC::grpc_plugin_support
gRPC::grpc++_reflection
protobuf::libprotobuf
)
//The directory containing a CMake configuration file for Protobuf.
Protobuf_DIR:PATH=/Users/danem/Programming/cpp/grpc/install_default/lib/cmake/protobuf
//The directory containing a CMake configuration file for absl.
absl_DIR:PATH=/Users/danem/Programming/cpp/grpc/install_default/lib/cmake/absl
//The directory containing a CMake configuration file for gRPC.
gRPC_DIR:PATH=/Users/danem/Programming/cpp/grpc/install_default/lib/cmake/grpc
set_target_properties(gRPC::grpc PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
INTERFACE_LINK_LIBRARIES "gRPC::zlibstatic;gRPC::cares;gRPC::address_sorting;gRPC::re2;gRPC::upb;m;Threads::Threads;absl::flat_hash_map;absl::inlined_vector;absl::bind_front;absl::hash;absl::statusor;absl::variant;absl::utility;gRPC::gpr;gRPC::ssl;gRPC::crypto;gRPC::address_sorting;-framework CoreFoundation"
)
Hello! I have a gRPC server that streams data for an indefinite amount of time. It spawns a child process that retrieves some hardware resources stats.
What I want is to cancel the gRPC call from the client so that I can kill the spawned process. Another solution would be a way to detect on the server when the client disconnects so that I can kill the process.
I am using grpc-node for both the client and the server. Do you know how I can do this?
grpc-js
and tryShutdown
. I'd expect that when I run tryShutdown
it would let any running unary grpc calls finish successfully, and close the server. But instead it actually cancels the stream, which makes the other end think that something went wrong, even after sending a successful response.
Caused by: java.lang.IllegalArgumentException: null frame before EOS
after calling clientStub.onNext(...)
. Is there a way to resolve this?
Hello! The benchmarks of python
pb
show an immense performance boost while using the option with c++
generated code. I tried searching for docs on how to use it but found none except a thread dating back to 2010. I then tried the solution but no significant change in performance occurred. Hence I'd like to know if:
Thanks in advance and please forgive me if this is the wrong place to ask. I believe this could be a big boost.
Save the date for the gRPC Community Meetup! Add this event to your calendar: https://bit.ly/37DUcJy
Performance Testing gRPC services by Mostafa Moradian
gRPC has gained a lot of attention as well as a wide adoption since it was first released. With the release of k6 v0.29.0, a native client for gRPC communication is introduced. In this talk, I'll go through the basics of performance testing in general and load testing gRPC services in particular.
Hi everyone, I'm trying to setup the grpc project building from source with python. I've successfully installed grpc but while running the tests with python tools/run_tests/run_tests.py -l python
the tests are failing due to the error -
Traceback (most recent call last):
File "/Users/s.sushmita@zomato.com/grpc/src/python/grpcio_tests/setup.py", line 21, in <module>
import grpc_tools.command
ModuleNotFoundError: No module named 'grpc_tools'
FAILED: py38.native.unit._server_shutdown_test.ServerShutdown [ret=1, pid=14880, time=0.1sec]
Can anyone help with this?
HTTP/2 error code: INTERNAL_ERROR, debug data: byte distribution write error
Thanks in advance!
io.grpc.StatusRuntimeException: INTERNAL: Connection closed after GOAWAY. HTTP/2 error code: INTERNAL_ERROR, debug data: byte distribution write error
at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:262) ~[grpc-stub-1.42.2.jar:1.42.2]
at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:243) ~[grpc-stub-1.42.2.jar:1.42.2]
at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:156) ~[grpc-stub-1.42.2.jar:1.42.2]
at com.rachio.api.device.DeviceServiceGrpc$DeviceServiceBlockingStub.getDeviceState(DeviceServiceGrpc.java:5946) ~[proto-1.0.272.jar:1.0.272]
at com.rachio.api.authentication.V3OpenAPIBridge.getDevice(V3OpenAPIBridge.java:270) ~[classes/:na]
at com.rachio.api.authentication.V3OpenAPIBridge.getPerson(V3OpenAPIBridge.java:210) ~[classes/:na]
at com.rachio.api.resource.rest.OpenAPIResource.getPerson(OpenAPIResource.java:177) ~[classes/:na]
at sun.reflect.GeneratedMethodAccessor219.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_322]
I'm using Python with grpc and the simple request/response borrowed from the helloworld example. This works fine, however I would like to facilitate a client notification in the event of a server shutdown.
What's the best way to make this happen? It seems like bidirectional streaming is the best (only) way? I'm not sure if this kind of event is supported when the client initiates all the activity.