Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Peter Sumner
    @saltxwater
    Hello! First time poster here. Just a question regarding DNS and connecting from (C#) clients: We're registering all our (docker) services in consul and they have random ports assigned by nomad. Our current workflow involves querying consul for the service info (address and port) and passing those straight through to "new Channel(host, port, ...)"
    We've now got consul set up as a dns resolver so I would LIKE to just call 'new Channel("dns://service.consul.mycompany.com")' and have the port determined by the DNS response (SRV records which include the port).
    Is this possible with the current state of things? If not, do you think it is a reasonable feature to request on github issues?
    Richard Belleville
    @gnossen
    @matrixbot grpcio is the best supported gRPC Python implementation. If you're having performance issues, that is something that we'd like to know about. Can you share any more of the particulars of your setup? Perhaps even code samples? What sorts of protos are you using? What are you doing inside of your servicers?
    Richard Belleville
    @gnossen
    @matrixbot It'd be helpful if you could gather that information together into an issue at https://github.com/grpc/grpc/issues/new/choose
    matrixbot
    @matrixbot
    xionbox Richard Belleville (Gitter): okay, I'll see what I can provide (it's a closed source project). Note that the timing numbers I gave earlier were actually based on an incorrect timing method. I've fixed this now, and re-running the benchmark
    Luca Lolli
    @dashandslash
    @ejona86 unfortunately there is no c++ api to shutdown a channel or explicitly change its state to GRPC_CHANNEL_SHUTDOWN
    Daniel
    @lumpidu
    @dashandslash : grpc::CreateChannel returns a shared_ptr, just call reset() on it
    Luca Lolli
    @dashandslash
    @lumpidu That will reset the shared_ptr destruct the object, not in any safe way...if you have any "wait" on the channel....well you might know what it´s going to happen..
    What I am trying to find out is how to change the GRPC_CHANNEL_READY state to GRPC_CHANNEL_SHUTDOWN
    Daniel
    @lumpidu
    @dashandslash : https://github.com/grpc/grpc/blob/master/src/cpp/client/channel_cc.cc: it will call grpc_channel_destroy(), which according to the documentation, "close and destroy a grpc channel". Why don't you think it's safe ?
    x0a1b
    @x0a1b
    Is there a way specify maximum number of requests per a server should handle per channel? This will help client's keep cycling connections and avoid traffic skew as pods in our cluster come up or go down.
    Eric Anderson
    @ejona86
    @x0a1b, no. I assume you are using pick_first (the default) load balancer on the channel. Proper thing to do is enable max connection age on server-side. That puts the service in control of its configuration.
    What language is your server in?
    Luca Lolli
    @dashandslash
    @lumpidu the reason why it´s not safe to destroy the shared_ptr is that if the channel is executing aWaitForStateChange on a thread...this will crash.
    Basically I want to do a WaitForStateChange(GRPC_CHANNEL_READY, timeout) in a separate thread, and somehow explicitly change the state of the channel or call a shutdown api to break the WaitForStateChange
    Yash Tibrewal
    @yashykt
    @dashandslash We don't have an API to explicitly change the state of the channel from READY. Waiting for the timeout to expire would be the most straightforward option.
    x0a1b
    @x0a1b
    @ejona86 server is in Java and I think maxConnectionAge will help
    cranemogul
    @cranemogul
    Hi, I have a question regarding protoc plugin development in Go.
    I'm processing service structures and would like to read method options; how can I do that?
    from MethodDescriptorProto I can only get Options, but what useful data can I get from them?
    Eric Anderson
    @ejona86
    You want the ServiceDescriptorProto which has method descriptors inside
    Wait...
    Now I'm confused. What do you mean by "only get Options". What additional data do you expect?
    cranemogul
    @cranemogul
    well, I can't get anything useful from Options object. For example, UninterpretedOption object is nil. In the file1.proto file, which I process, the method looks like
    rpc M1(MI) returns (MO) {
    option (google.api.http) = {
    post: "/v1/m"
    body: "*"
    };
    }
    Eric Anderson
    @ejona86
    I think there are proto2 extensions in it.
    Each option is a proto2 extension.
    cranemogul
    @cranemogul
    how can I extract this data - for example, "/v1/m" - from Options?
    ok, then how should I proceed? I've tried GetExtension, HasExtension... compiler says there are no such things in MethodOptions
    So you want the HttpRule extension from the MethodOptions message.
    cranemogul
    @cranemogul
    yes
    Eric Anderson
    @ejona86
    Looks like it is a function (not a method) you have to call
    https://github.com/golang/protobuf/blob/master/proto/extensions_test.go#L54
    cranemogul
    @cranemogul
    am I missing some import?..
    Eric Anderson
    @ejona86
    A bit strange, but works I guess.
    cranemogul
    @cranemogul
    so I should mention HttpRule structure as a parameter to GetExtensions?..
    Eric Anderson
    @ejona86
    I think there should be a ExtensionDesc in the generated code for annotations.proto. You would pass that to GetExtensions()
    Looks like the name will be prefixed with E_
    cranemogul
    @cranemogul
    I saw this, but not sure how to translate that into Go
    cranemogul
    @cranemogul
    GetExtensions() failed: proto: not an extendable proto.Message
        exts, err := proto.GetExtensions(curMethod, []*proto.ExtensionDesc {
            pb.E_Ext_More,
            pb.E_Ext_Text,
            //HttpRule http = 72295728;
        })
        if err != nil {
            log.Fatalf("GetExtensions() failed: %s", err)
        }
    Eric Anderson
    @ejona86
    I'm not sure.
    cranemogul
    @cranemogul
    it's good it compiles at all :) - sometimes it's not easy to achieve... structures are unclear...
    here I had to import pb "github.com/golang/protobuf/proto/test_proto"
    thank you Eric. Will think some more...
    asaf david
    @asafdav2
    Hi, a question regarding health check - my service is running in GCP, and needs to respond to GCP healthchecks which are one of TCP, HTTP, H2 but not gRPC. is there any way to make it talk with a HC service that implements the gRPC HC protocol? I have envoy sidecar if that's helpful (I see that envoy has ability to HC gRPC cluster but i'm not sure if i can leverage it)
    Eric Anderson
    @ejona86
    @asafdav2, TCP health check would be normal today. We've looked into gRPC-native health checks, but I don't think there is anything to share at the moment.
    Alexey Edelev
    @semlanik
    Hi I sent request using this form https://docs.google.com/forms/d/119zb79XRovQYafE9XKjz9sstwynCWcMpoJwHgZJvK74/viewform?edit_requested=true to add my project to gRPC community, should I expect any response?
    Eric Anderson
    @ejona86
    @semlanik, I don't really know, but I'd assume so given the many projects added to grpc-ecosystem.
    Pablo Cariel
    @pcariel
    Hi, vertx hazelcast using eventbus ?
    Dmitrii Ustiugov
    @ustiugov

    hi! I am trying to build gRPC with cmake from the external project
    grpc/examples/cpp/helloworld/cmake_externalproject

    The issue is that I cannot configure the Release build to enforce compiler's "-O2" optimizations without hacking through all dependencies' CMakeLists.txt (e.g., gRPC, protobuf, zlib, etc)

    It's difficult to believe that there is no easy way to switch the optimizations on and off in gRPC....

    cranemogul
    @cranemogul
    Is there a way to generate Swagger files (using Swagger protoc plugin) only for services, and not generate Swagger files for other .proto files, which don't contain services?