Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    danem
    @danem
    I've ensured that I'm referencing protobuf and abseil from my grpc build.
    Here is the basic CMakeLists.txt which still results in the duplicate symbols error:
    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
    )
    I made a test project that DOES work however:
    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
    )
    In both CMake Cache is set to the following:
    //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
    danem
    @danem
    the conflicting libraries are libgrpc.a, libupb.a, and libgpr.a
    danem
    @danem
    Continuing on this... Looking at the cmake for grpc i can see that grpc::grpc explicitly links grpc::upb and grpc::gpr which causes the conflicts...
    1 reply
    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"
    )
    Bogdan Boamfa
    @xbogdan

    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?

    1 reply
    Robin Liu
    @RobinLG
    Hello. I want to merge branch in github. And I signed CNCF document. But still can't accessed by EasyCLA bot. How can I do?
    Robin Liu
    @RobinLG
    Sorry to interrupt. solved. :)
    Aidan
    @artificial-aidan
    Question about 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.
    6 replies
    Daniel Wahlqvist
    @offroff
    I'm using grpc-java and I've implemented ClientResponseObserver giving me the ability to do cancel on the request. When I do cancel the server successfully cancels and I get an error back to the ClientResponseObserver, the error simply says "CANCELLED". This seems pretty normal to me but my colleague thinks the error is a problem. Is it? Or is the error how it's supposed to be?
    5 replies
    binh-stripe
    @binh-stripe
    Hello! I have a gRPC stream JAVA client consuming from an event bus like gRPC stream. Occasionally, the stream crash with error Caused by: java.lang.IllegalArgumentException: null frame before EOS after calling clientStub.onNext(...). Is there a way to resolve this?
    4 replies
    Karol Janik
    @karol-janik
    Hello! Do you guys have some repository with examples of usage pagination in grpc, following the aip.dev standards (https://google.aip.dev/158)?
    Ujjwal Jha
    @UjjwalJ31245321_twitter
    Hi All, Can we call a rest Api from gRPC server and if so can someone help how to do it?
    Karol Janik
    @karol-janik
    @UjjwalJ31245321_twitter PTAL at https://github.com/grpc-ecosystem/grpc-gateway :)
    Ujjwal Jha
    @UjjwalJ31245321_twitter
    @karol-janik Thanks for the help, how to add the HTTPheaders in Option's GET method?
    Ujjwal Jha
    @UjjwalJ31245321_twitter
    Hi All, can anyone please help me to call a rest api through GRPC using java?
    1 reply
    elderorb
    @ElderOrb
    what could be the reason for the following code occasionally stucked:
                        var connectTask = channel.ConnectAsync(connectDeadline)
                        await connectTask; // this line stucks
    var connectDeadline = DateTime.UtcNow.AddSeconds(ConnectTimeutInSec);
    Daniel Wahlqvist
    @offroff
    I get an error INTERNAL and trying to figure out what the problem is. At first I thought this must happen on the server but when reading here https://grpc.github.io/grpc/core/md_doc_statuscodes.html it seems this can be a client error as well? How do I figure out where this error code originated? I'm running grpc-java on the client and the server is golang (I can't debug the server though)
    12 replies
    mach881040
    @mach881040
    Can I build a python web server that can hold onto at least tens of thousands of POST requests while sending the payloads to workers who return the results, and autoscaling workers based on request / worker ratio, using gRPC for Python?
    AND2797
    @AND2797
    hi
    i want to sign the CLA, how do i do that exactly?
    Ivan Hristov
    @IvanHristovVia

    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:

    1. the option is still relevant and viable?
    2. there is any proper guide on how to implement it?

    Thanks in advance and please forgive me if this is the wrong place to ask. I believe this could be a big boost.

    2 replies
    slooker
    @slooker
    Is there a good way to write an interceptor (middleware) to handle auth in node.js? I've looked at the few packages I can find, and it seems like you can add auth for things like logging, but I don't see a good way to stop a call that fails authorization.
    kyle-wong-knewton
    @kyle-wong-knewton
    HI, I'm building out a client which connects to a grpc-java service and was wondering when a Managed channel should be configured with an executor. I haven't been able to find much documentation about this executor or when to provide a custom one.
    1 reply
    Tulsi
    @im_tpj_twitter
    Hi, I'm trying to call grpc endpoint running on EC2 from AWS Lambda. I'm stuck with this error while calling grpc API - rpc error: code = Unavailable desc = connection closed before server preface received
    Is it some network issue?
    teyzaalvarez
    @Teeyz_twitter

    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.

    Subhdeep Saha
    @subhdeep
    Is there any reference to how gRPC allocates memory buffer when receiving messages ?
    I want to increase MaxCallRecvMsgSize for larger payloads, what memory implication will it have ?
    9 replies
    Vitya Chyzhyk
    @6juara9
    Hi everyone, could someone help me with GRPC default values memory allocation. What if we have a message and in the client for example we do not set some fields. So, my question is: do these fields with default values take some memory in the transport layer or they're ignored and set to the default values on the server-side?
    3 replies
    dave103
    @dave103:matrix.org
    [m]
    Hello guys, i am learning gRPC and would like to play around with it. Are there any publicly available gRPC endpoints? I couldn't find any googling so far :( I don't want to create my own service, but learning how to use one and test it with my own client or grpcurl.
    1 reply
    Ayoubelhouche
    @Ayoubelhouche
    image.png
    i need help accessing this variable
    its _result
    in the class ServerResponse
    Sushmita
    @17sushmita

    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?

    fgarsombke
    @fgarsombke
    Thoughts on this error? Googling hasn't provided any information. We see this very infrequently, and would just like to understand if this is a true error or not, and how to resolve if possible. HTTP/2 error code: INTERNAL_ERROR, debug data: byte distribution write error Thanks in advance!
    2 replies
     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]
    Iwan Aucamp
    @aucampia
    Is there some libraries for processing proto files in Python?
    Jiawen Wang
    @Homura2333
    Hi everyone, I'm trying to test my gRPC service using ghz, and I found there are many error requests with error code "Unavailable desc = transport is closing". Does anyone know the reason? Thanks in advance!
    D756100E-B6C6-420B-AD3E-73EDF8897892.png
    Flaviu
    @cflaviu
    Hi, I just built the latest version of grpc using bazel. Does bazel have an "install" command similar to cmake's make install to install the resulted grpc library?
    Clint Olsen
    @clintolsen

    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.

    Martin Mok
    @metazen-martinmok:matrix.org
    [m]
    Hi do anyone know some tools to generate openapi spec from proto?
    1 reply
    teyzaalvarez
    @Teeyz_twitter
    Hello, guys! We are live at the gRPC Community Meetup! Join us now: https://meet.google.com/rnf-vyyi-qtb?pli=1&authuser=4
    Cassiel-girl
    @Cassiel-girl
    Scenario: Multiple clients request to a broker to send themselves large batches of file data stored in the broker.
    Multiple clients connect to a broker, then the clients send request commands (small data) to the broker, and the broker receives the command requests from these clients via poll (the broker code is socks = poll()), with socks indicating the clients that initiated the command requests. Then, the broker needs to send the requested bulk file data to these clients.
    I can think of two ways for the broker to send these large amounts of file data to the clients.
    1. the broker sends the bulk file data directly to each requesting client using the socks above.
    2. the broker creates a connect socket for each client and connects to the socket binded on each client side. Then the broker sends the bulk file data to each client through this connect socket.
      Which is the better solution? Is it more common?
    6 replies
    Michal Zalecki
    @MichalZalecki_twitter
    Hi! Do you know what's the state of ALTS? Is per-pod identity available for everyone or you need to be part of Early Access Program? If so, what's the beast way to reach out and request access?
    Jakob M
    @JakobMei
    Hey y'all.
    For my bachelor thesis I've done some kind of gRPC vs. REST (or at least HTTP/1.1 with JSON) performance Benchmark.
    If you are interested, you can take a look here: https://github.com/JakobMei/ba_grpc_rest
    Its a maven project with multiple modules: One Spring Boot server with the REST and gRPC-API, one proto module for code generation and one client with the Java Microbenchmarking Harness to test it.
    I guess its probably fairly naive and not 100% scientific correct but if you have any feedback, feel free ;)
    3 replies
    grpc_rest_chart.png