[grpc-io] Re: how can i use channelz in java?

2019-07-31 Thread 'Carl Mastrangelo' via grpc.io
Hi! I am the primary author of Channelz.Right now Channelz is a gRPC service which means that it needs to be manually added to your server, and called using a gRPC client.If you have a working server, just add ChannelzService to it. At the moment, we have a very hacky Web UI for

[grpc-io] Re: receiving the byte array for a protobuff in a streaming grpc

2019-06-24 Thread 'Carl Mastrangelo' via grpc.io
You don't have to use the proto generated stubs. You can make your own serializer / deserializer and persist the data. You can even delegate to the next serializer and reuse the proto ones, if you want. (this is for Java) On Monday, June 24, 2019 at 7:18:50 AM UTC-7, Elhanan Maayan wrote:

[grpc-io] Re: Thread leak while use ManagedChannel in grpc Java

2019-06-24 Thread 'Carl Mastrangelo' via grpc.io
You'll need to include a thread dump to diagnose this further. On Wednesday, June 19, 2019 at 8:52:54 PM UTC-7, Deepak Agarwal wrote: > > Hi all, > I am using grpc java as a grpc client to connect to a remote GRPC > server. The RPC is a server streaming RPC. > I first build the channel

[grpc-io] Re: Implementing client streaming on server side (java)

2019-06-19 Thread 'Carl Mastrangelo' via grpc.io
Regular hashMap is enough, as long as there is exactly one map per RPC. If there are multiple RPCs, you will need to synchronize. (Stated differently: each request StreamObserver and map pair should be 1-1 and onto, e.g a bijection). More detail: each RPC has an associated

[grpc-io] Re: Julia language

2019-06-17 Thread 'Carl Mastrangelo' via grpc.io
Sorry, I don't think anyone on the gRPC team has Julia experience. On Sunday, June 16, 2019 at 12:56:17 AM UTC-7, ondrej...@gmail.com wrote: > > Hi, > > Are there any plans to support Julia language? > > Best Regards, > > Ondra > > -- You received this message because you are subscribed to

[grpc-io] Re: java grpc server how to handle RejectedExecutionException

2019-06-17 Thread 'Carl Mastrangelo' via grpc.io
Never set a max queue size on the executor. Instead, use the ClientCall.request() and ServerCarll.request() methods to avoid overloading the queue. If your server or client is overloaded, just accept the RPC and immediately close it. On Monday, June 10, 2019 at 8:48:16 PM UTC-7,

[grpc-io] Re: Switch Network interfaces while stream is running

2019-06-14 Thread 'Carl Mastrangelo' via grpc.io
Replies inline: On Friday, June 14, 2019 at 12:15:29 AM UTC-7, tob...@googlemail.com wrote: > > Hi group, > > are there any experiences here how GRPC handles a switch of the network > interface while a bi-di stream is running? > Sorry, this is not supported currently. It is theoretically

[grpc-io] Re: Allow complete override of User-Agent Header on a per-RPC level from grpc client libraries

2019-06-12 Thread 'Carl Mastrangelo' via grpc.io
Probably a better place to bring this up is as an issue on the GitHub tracker, as a feature request: https://github.com/grpc/grpc-java/issues On Tuesday, June 11, 2019 at 12:40:18 PM UTC-7, Asad Ali wrote: > > bump. > > i am not sure if this was the right forum to bring this up. > any advice on

[grpc-io] Re: Detecting bad connection in java

2019-06-05 Thread 'Carl Mastrangelo' via grpc.io
You'll need to read the docs of that method I linked (and the other ones with "keepalive" in the name). It discusses what will happen with regards to active calls. On Wednesday, June 5, 2019 at 11:02:34 AM UTC-7, yfe...@gmail.com wrote: > > Hey Carl, > > Thanks for your help with this! > > Is

[grpc-io] Re: Detecting bad connection in java

2019-06-05 Thread 'Carl Mastrangelo' via grpc.io
Try setting the keep alive settings defined here: https://grpc.github.io/grpc-java/javadoc/io/grpc/ManagedChannelBuilder.html#keepAliveTimeout-long-java.util.concurrent.TimeUnit- On Wednesday, June 5, 2019 at 10:48:38 AM UTC-7, yfe...@gmail.com wrote: > > Hey folks, > > I'm making calls using a

[grpc-io] Re: Servers in PHP?

2019-06-05 Thread 'Carl Mastrangelo' via grpc.io
There isn't support for running a PHP gRPC server (and nothing on the roadmap either).You might be able to convert an HTTP/2 request to an HTTP/1.1 request and forward that to the PHP server, but I am not sure how the server can respond with trailers. The spec for gRPC is here:

[grpc-io] Re: Is it possible to setup gRPC on board

2019-06-05 Thread 'Carl Mastrangelo' via grpc.io
We don't support C directly; it is only used to interact across language bounds (such as plugging into Python, Ruby, PHP, etc.) . That said, gRPC does run on a lot of environments, and on varied hardware. I suspect you could get it working. On Tuesday, May 28, 2019 at 1:38:25 AM UTC-7,

[grpc-io] Re: c++ empty response async example

2019-06-05 Thread 'Carl Mastrangelo' via grpc.io
Can you build the examples that come with gRPC? Your error looks like you might not have protobuf installed. On Thursday, May 30, 2019 at 8:53:40 AM UTC-7, 윤석영 wrote: > > Can I get example codes for c++ empty reponse in async mode > > My current code occurs compile error. > > > struct

[grpc-io] Re: Building gRPC, Protobuf, etc with SCons

2019-06-05 Thread 'Carl Mastrangelo' via grpc.io
Hi, We currently don't support SCons, and don't know of anyone else who has used it with gRPC. We are not opposed to accepting contributions to generating the configuration for SCons from our source of truth (a YAML file which we use to generate Make, CMake, and Bazel build files). On

[grpc-io] Re: When grpc client buffers in HTTP/2

2019-06-05 Thread 'Carl Mastrangelo' via grpc.io
Hi, The deadline starts as soon as it gets from the Stub into the core library (i.e. after it passes through all interceptors). The "deadline" is a specific point in time after which the RPC is no longer valid. When you set a deadline on an RPC, the buffering doesn't come into account,

[grpc-io] Re: Relying on IllegalStateException: Call already half-closed

2019-06-05 Thread 'Carl Mastrangelo' via grpc.io
There is no side effect. The gRPC library checks the state before making any mutations. It's still a bug to call it twice.What is the use case? On Tuesday, June 4, 2019 at 2:18:03 AM UTC-7, changxu wrote: > > Hi all, > > I wanted to know if sending second onCompleted on already half-closed

Re: [grpc-io] Re: Standardization of rich error reporting via google.rpc.Status

2019-05-31 Thread 'Carl Mastrangelo' via grpc.io
ting your > representation model and optionally creating helper libraries to augment > the gRPC libraries and assist with producing and consuming the error > details. > > Some things to be aware of if you adopt such an extended error model, > however are ... > > On Thu, May

[grpc-io] Re: Standardization of rich error reporting via google.rpc.Status

2019-05-23 Thread 'Carl Mastrangelo' via grpc.io
gRPC is not directly a Google product, it's donated to the CNCF. Google has use cases where google.rpc.Status is sufficient, but there are a LOT of other companies that have different use cases and requirements. The Proto status can be impractical on Android for instance, where Protos cause

[grpc-io] Re: Retry to establish TCP Connection

2019-05-23 Thread 'Carl Mastrangelo' via grpc.io
The client does reconnect, but the RPC may fail. RPCs that have not yet started will likely be sent to a different backend instead of waiting on a re-established connection. The number of retries is not limited. Instead, the deadline on the RPC controls how long before the RPC fails. The

[grpc-io] Re: How can GRPC server know if client is down when data is streaming from client to server .

2019-05-21 Thread 'Carl Mastrangelo' via grpc.io
You can tell if a client is done using ServerTransportFilter, but you cannot use it to associate if a particular RPC is associated with the transport. You can only tell if a client RPC is done (successful or not) using the StreamObserver api (and sub classes), or using the ServerCall.Listener

[grpc-io] Re: Where is the ServiceConfig proto definition?

2019-05-21 Thread 'Carl Mastrangelo' via grpc.io
Alas, there is no public proto. There was one internal to Google, but when Service Config was open sourced the definition was made to be JSON to avoid taking a proto dependency. The specification of it is structurally compatible to a Proto (using the proto3 JSON form), but gRPC doesn't use

[grpc-io] Re: gRPC-Java deadline exceeded scalability

2019-05-21 Thread 'Carl Mastrangelo' via grpc.io
Responses inline On Tuesday, May 21, 2019 at 7:07:11 AM UTC-7, sut...@gmail.com wrote: > > Hi folks, > > I'm interested in understanding how gRPC-Java might behave in a > pathological situation where a vast number of client requests start timing > out causing a deadline exceeded avalanche. If a

[grpc-io] Re: Which k8s ingress controller is "blessed" by gRPC community?

2019-05-02 Thread 'Carl Mastrangelo' via grpc.io
I haven't personally run with it, but there is active development from Google on Envoy, so it typically has good support. Any of those with Envoy support would be what I would look at first. (again, taking into account my inexperience). On Tuesday, April 30, 2019 at 2:54:01 PM UTC-7,

[grpc-io] Re: Grpc Java Server Side Streaming server stream cancellation detection

2019-05-02 Thread 'Carl Mastrangelo' via grpc.io
You can turn on keep alives on the channel / server builder, but that's about the best you can do. The problem is that a broken connection just means silence. You can't tell the difference between the packets taking a long time, and the the packets not arriving. Keep-alives let you check the

[grpc-io] Re: how to bind grpc client to specific network interface

2019-04-26 Thread 'Carl Mastrangelo' via grpc.io
What language? On Friday, April 26, 2019 at 2:58:08 PM UTC-7, joe.p...@decisionsciencescorp.com wrote: > > Is it possible to pass a parameter to grpc that allows clients to pick a > specific network interface on a computer with multiple ethernet interfaces? > -- You received this message

[grpc-io] Re: We made a gRPC GUI Client

2019-04-19 Thread 'Carl Mastrangelo' via grpc.io
Looks neat! You should post it too on twitter. On Thursday, April 18, 2019 at 9:44:03 AM UTC-7, roca...@gmail.com wrote: > > For those interested in gRPCs - myself and a couple of developer friends > put together a gRPC GUI client! Here are some details. > > - It's written in TS, aimed at

[grpc-io] Re: Posting example code for asynchronous streaming implementation [subscription based services]

2019-04-10 Thread 'Carl Mastrangelo' via grpc.io
You can normally get multiple wakeups from gRPC. I think it is documented implicitly by the wire protocol. On Wednesday, April 10, 2019 at 6:12:50 AM UTC-7, windf...@gmail.com wrote: > > This really helped me, just wanted to thank you for it. The trick I was > missing is the multiple wake

[grpc-io] Re: Load balancing over pool of bidirectional streams

2019-04-09 Thread 'Carl Mastrangelo' via grpc.io
Not sure what you mean.gRPC Channels are loadbalanced, but not the messages on individual RPCs. If you repeatedly fire unary RPCs on your stub (or Channel) they will be load balanced across all the backends. On Saturday, April 6, 2019 at 10:21:41 AM UTC-7, Matt Mitchell wrote: > > Hi.

[grpc-io] Re: Java gRPC: multiple bidirectional streams, onNext blocking problems

2019-04-09 Thread 'Carl Mastrangelo' via grpc.io
StreamObserver is not threadsafe, and they need external synchronization to be shared. Also, gRPC threads are provided by your application when you pass an Executor to the ManagedChannel or the Server. You can control that blocking. On Saturday, April 6, 2019 at 10:09:10 AM UTC-7, Matt

[grpc-io] Re: Java gRPC: multiple bidirectional streams, onNext blocking problems

2019-03-28 Thread 'Carl Mastrangelo' via grpc.io
I'm having a hard time understanding your example, can you provide a sample snippet of your sever side StreamObserver? On Tuesday, March 26, 2019 at 9:54:30 AM UTC-7, Matt Mitchell wrote: > > Hello. I'm debugging bidirectional streaming application. A server thread > obtains a client

[grpc-io] Re: Return scalar type field instead of message

2019-03-20 Thread 'Carl Mastrangelo' via grpc.io
This kind of question would be better asked on StackOverflow. The short answer is that Messages provide the backwards and forwards compatibility guarantees that Protobuf offers. bools do not. On Wednesday, March 20, 2019 at 3:10:02 AM UTC-7, Martin Scholz wrote: > > Why it is not possible to

[grpc-io] Re: Deadlines with infinite streams

2019-03-18 Thread 'Carl Mastrangelo' via grpc.io
Deadlines apply to the whole RPC. However, you can make an interceptor that cancels the RPC if a message hasn't been received in a time period. Without going into too much detail, there are lots of different ways to handle deadlines in the streaming case, so gRPC punts this up to the

[grpc-io] Re: GRPC Communication with multiple remote agents and also scale

2019-03-14 Thread 'Carl Mastrangelo' via grpc.io
Start 1000 Channels, send the messages, collect the responses. gRPC should easily scale to that number. Can you clarify more what you are looking for? On Wednesday, March 13, 2019 at 8:10:22 PM UTC-7, Vishal Pandya wrote: > > Can somebody please throw light on asynchronous solutions to how

Re: [grpc-io] Re: gRFC A3: Channel Tracing

2019-03-07 Thread 'Carl Mastrangelo' via grpc.io
Inline responses: On Thursday, March 7, 2019 at 7:19:41 AM UTC-8, Mark D. Roth wrote: > > On Wed, Mar 6, 2019 at 2:29 PM 'Carl Mastrangelo' via grpc.io < > grp...@googlegroups.com > wrote: > >> Mark: I would be interested in taking over this, assuming you don't hav

Re: [grpc-io] Re: gRFC A3: Channel Tracing

2019-03-06 Thread 'Carl Mastrangelo' via grpc.io
Mark: I would be interested in taking over this, assuming you don't have many more concerns. I have two changes I would like to propose as well: 1. Add a CT_DEBUG level between CT_UNKNOWN and CT_INFO. ChannelTraces at the DEBUG level are *never* surfaced up to channelz, and

[grpc-io] gRPC Java 1.19.0 Released

2019-02-28 Thread 'Carl Mastrangelo' via grpc.io
gRPC Java 1.19.0 is now released. It should be ready use from Maven Central and JCenter. https://github.com/grpc/grpc-java/releases/tag/v1.19.0 Dependencies and Build Changes - Upgraded to protobuf 3.6.1 (#5320 ) - Google App Engine

[grpc-io] Re: how to detect version of gRPC?

2019-02-28 Thread 'Carl Mastrangelo' via grpc.io
What language are you using? On Thursday, February 28, 2019 at 7:43:51 AM UTC-8, heman...@gmail.com wrote: > > I downloaded gRPC for use from github. How do I find out what version of > gRPC this software is? I don't see a VERSION file with the software. > > For example, with protobuf, I

[grpc-io] Re: Unimplemented Method on Linux / Windows

2019-02-28 Thread 'Carl Mastrangelo' via grpc.io
That sounds like a bug in your code. That error would not be raised by changing JVMs. On Thursday, February 28, 2019 at 6:11:54 AM UTC-8, marcel.moehring wrote: > > Hello, > > > > we are currently migrating projects to JDK 11 and are experiencing the > strange problem where JARs compiled on

[grpc-io] Re: Future of GRPC-LB

2019-02-25 Thread 'Carl Mastrangelo' via grpc.io
Like Penn said, you can turn it on (it's experimental), but will eventually be replaced. The flag itself is pretty simple, but the rest of the machinery needs to be set up properly for it to work. We (gRPC maintainers) are not comfortable supporting this yet, hence the extra effort to turn

[grpc-io] Re: debugging opencensus rpcz?

2019-02-25 Thread 'Carl Mastrangelo' via grpc.io
Do you mean the Census Z page implementation? On Sunday, February 24, 2019 at 7:39:34 PM UTC-8, Derek Perez wrote: > > I have zpages enabled on my Netty-based grpc server and I'm not seeing > any data when I visit /rpcz > > I do see data when I visit /tracez so its definitely wired up and >

Re: [grpc-io] Re: grpc-java: Register all channels / access root channel list

2019-02-22 Thread 'Carl Mastrangelo' via grpc.io
they can be shut down. > > Thank you again for your help. > > Sam > > On Fri, Feb 22, 2019 at 1:48 PM 'Carl Mastrangelo' via grpc.io < > grpc-io@googlegroups.com> wrote: > >> The warning you see is triggered by the garbage collector (via a >> WeakRef), so lik

[grpc-io] Re: grpc-java: Register all channels / access root channel list

2019-02-22 Thread 'Carl Mastrangelo' via grpc.io
The warning you see is triggered by the garbage collector (via a WeakRef), so likely the Channel won't show up in Channelz when you see the message. If you don't have references to these channels, then it won't be possible to shut them down directly. If you can create them (such as in your

[grpc-io] Re: Java grpc FutureStub threads question

2019-02-21 Thread 'Carl Mastrangelo' via grpc.io
By executing, you mean you are calling methods on the Future Stub? If so, the completion of the future, and other callbacks, are executed on the executor provided to the channel when it was created (you can also fork the stub with your own executor). gRPC will always complete the future on

[grpc-io] Re: Client-side visibility of server canceling context

2019-02-21 Thread 'Carl Mastrangelo' via grpc.io
Let me re-establish somethings just to make sure we are on the same page. 1. Servers are always async. Server Stubs are always passed a Response observer. For Bidi and Client Streaming, they also return a Request Observer. 2. Servers are usually on the receiving end of cancellation.

[grpc-io] Re: Using multiple late-bound services

2019-02-21 Thread 'Carl Mastrangelo' via grpc.io
Inline responses On Wednesday, February 20, 2019 at 2:56:12 PM UTC-8, Geoff Groos wrote: > > I think we're on the same page. > > So if you've got an API user who connect to your API with some kind of > functionality that he wants to offer, (thinking in the vein of callbacks in > C# or java),

[grpc-io] Re: Client-side visibility of server canceling context

2019-02-21 Thread 'Carl Mastrangelo' via grpc.io
I think you need to call `attach()` on the context to install it (rather than just construct it). Normally this sticks it in a thread local which gRPC then reads from. On Wednesday, February 20, 2019 at 2:08:03 PM UTC-8, rmar...@hubspot.com wrote: > > > In the context of server streaming or

[grpc-io] Re: Using multiple late-bound services

2019-02-15 Thread 'Carl Mastrangelo' via grpc.io
Inline responses On Thursday, February 14, 2019 at 3:10:45 PM UTC-8, Geoff Groos wrote: > > Thanks Carl, > > I think the client-server naming is only causing me problems, so Instead > I'll use the real names which are optimizer (server above) and simulator > (client above). They are more like

[grpc-io] Re: Using multiple late-bound services

2019-02-14 Thread 'Carl Mastrangelo' via grpc.io
Some comments / questions: 1. Why doesn't "rpc register" get split into two methods, one per type? Like "rpc registerCee (CeeRegRequest) returns (CeeRegResponse);" 2. Being careful with terminology, you have multiple "services" on a singe "server", and the "server" is at one address. 3.

[grpc-io] Re: SEGFAULT in greeter_client

2019-02-13 Thread 'Carl Mastrangelo' via grpc.io
Hi, can you file an issue on gRPC's GitHub issue tracker? https://github.com/grpc/grpc/issues/new On Thursday, January 24, 2019 at 7:37:05 AM UTC-8, Gautham B A wrote: > > Hi all, > > I just cloned and built gRPC > (SHA 9ed8734efb9b1b2cd892942c2c6dd57e903ce719). I'm getting SEGFAULT when I >

[grpc-io] Re: StatusRuntimeException with gRPC stream: Channel closed

2019-02-13 Thread 'Carl Mastrangelo' via grpc.io
Cancellation is usually done by your application code, unless there is a proxy in the path. There is no default time limit, and RPCs will never time out normally. You can add one by setting a deadline on the stub. Deadlines will fail with a DEADLINE_EXCEEDED error code, rather than a

[grpc-io] Re: Does grpc-java supports cert reload without restarting server?

2019-02-07 Thread 'Carl Mastrangelo' via grpc.io
You are correct, Java doesn't support this. However, if you are using the round robin load balancer in your client, you should be able to gracefully restart your servers with the new certificate without dropping any requests. On Thursday, February 7, 2019 at 6:52:46 AM UTC-8, Danesh Kuruppu

Re: [grpc-io] Re: Is there a python interceptor that generates access logs?

2019-02-07 Thread 'Carl Mastrangelo' via grpc.io
:25:59 AM UTC-8, robert engels wrote: > > Might be a better question, is it silly to start any python service in > 2019, given the alternatives available like Go. :) > > > On Feb 7, 2019, at 10:39 AM, Ross Vandegrift > wrote: > > > > On Wed, 2019-02-06 at 09

[grpc-io] Re: Is there a python interceptor that generates access logs?

2019-02-06 Thread 'Carl Mastrangelo' via grpc.io
There was some work on binary logs to dump the traffic to disk (for replay), but It wasn't anything like access logs. I assume you mean something like Apache's log per request. If you are considering writing one, I foresee a few problems: 1. Streaming calls may take a long time. Should

[grpc-io] Re: errors when linking with protobuf-lite

2019-01-17 Thread 'Carl Mastrangelo' via grpc.io
Do you have c-ares ( https://c-ares.haxx.se/ ) somewhere on your system? On Thursday, January 17, 2019 at 11:10:17 AM UTC-8, joe.p...@decisionsciencescorp.com wrote: > > I have built gRPC with protobuf-lite support and added > the -DGRPC_USE_PROTO_LITE compiler switch along with option

[grpc-io] Re: gRPC client side RoundRobin loadbalancing w/ Consul DNS

2019-01-17 Thread 'Carl Mastrangelo' via grpc.io
I know you asked for C++, but At least for Java we do not honor TTL. (because the JVM doesn't surface it to us). If you implement your own NameResolver (not as hard as it sounds!) you can honor these TTLs. I believe C++ uses the cares resolver which IIRC can resort to doing TCP lookups if

[grpc-io] Re: gRPC java client side TLS authentication using root.pem file and using username and password.

2019-01-17 Thread 'Carl Mastrangelo' via grpc.io
You are going to need to clarify some more, I can't tell what's going on in your setup. Where do the username and password come from? Why aren't you using an authentication token?Have you read our Mutual TLS guide here https://github.com/grpc/grpc-java/blob/master/SECURITY.md#mutual-tls

[grpc-io] Re: relaying grpc calls

2019-01-14 Thread 'Carl Mastrangelo' via grpc.io
Yes, this is possible. You'll need to implement some unpacking scheme on L, but it can then forward the raw bytes of the request. Note that if you are using Proto, you may not be able to use all the generated stub code. If C, L, and R all know about the same message types, then you can

[grpc-io] Re: gRPC inproc transport

2019-01-03 Thread 'Carl Mastrangelo' via grpc.io
I am the author of the blog post. The pictures included are an approximation of the truth, which would otherwise be very complicated. I tried to convey as much information as possible without being too inaccurate, but as you noticed it isn't right for C# (or any wrapped language except for

[grpc-io] Re: What is the maximum message size

2018-12-17 Thread 'Carl Mastrangelo' via grpc.io
The largest I've seen is about 40M, and it was due to extremely complex proto files, rather than large byte arrays. The large proto had to be updated transactionally, so it couldn't be split into smaller parts. On Thursday, December 13, 2018 at 10:14:06 AM UTC-8, Oregonduckman wrote: > > I

[grpc-io] Re: The bidirectional stub life cycle

2018-12-17 Thread 'Carl Mastrangelo' via grpc.io
Responses inline On Thursday, December 13, 2018 at 7:06:13 AM UTC-8, for.sh...@gmail.com wrote: > > Hi All > > I have a question about the bidirectional stub. I'm using gRPC-java 1.16.1. > > If the server side call onCompleted or onError. Does it mean the stub has > already been closed or just

[grpc-io] Re: Measuring latency using ClientInterceptor/ForwardingClientCallListner

2018-12-05 Thread 'Carl Mastrangelo' via grpc.io
It is not correct. The start time needs to be set when ClientCall.start() is invoked, rather than when the listener is constructed. Aside from that it looks okay. On Tuesday, December 4, 2018 at 2:26:22 PM UTC-8, rahul.n.m...@verizon.com wrote: > > Hi > > I am working on quick solution to

Re: [grpc-io] Re: gRPC over the internet at scale

2018-12-03 Thread 'Carl Mastrangelo' via grpc.io
pps? > > Yes, our concern with network middle boxes is primarily around their lack > of support / active blocking of HTTP2 upgrades. > > On Thu, Nov 29, 2018 at 1:10 PM 'Carl Mastrangelo' via grpc.io < > grp...@googlegroups.com > wrote: > >> I can't speak for mo

[grpc-io] Re: grpc connections

2018-12-03 Thread 'Carl Mastrangelo' via grpc.io
In your case, 1 Channel, 1 connection. Since there is one single IP address, all traffic will be routed to it. (if you had 4 IP addresses, it would be 1 channel, 4 connections). I'm not sure what to say about the usage of Netty. The connections are actually synchronous, but use non

[grpc-io] Re: Measuring gRPC-Java Unary Client Requests Latency From Interceptor

2018-11-30 Thread 'Carl Mastrangelo' via grpc.io
One of the JVM contributors, Aleksey Shipilёv, has a great blog post on nanoTime. I highly recommend his short post about it: https://shipilev.net/blog/2014/nanotrusting-nanotime/ On Friday, November 30, 2018 at 8:01:53 AM UTC-8, Yee-Ning Cheng wrote: > > Ah you were right, user error..

[grpc-io] Re: grpc connections

2018-11-30 Thread 'Carl Mastrangelo' via grpc.io
gRPC uses a "channel" rather than a "connection" as the surface level API. A channel is a managed set of connections to your server(s). The number of connections could drop down to 0 if they are idle, or be as large as every server returned by your DNS entries. gRPC has two pluggable

[grpc-io] Re: Repeated blog article rss feed

2018-11-30 Thread 'Carl Mastrangelo' via grpc.io
This has been fixed, and unfortunately caused the URL to change. It's now at https://grpc.io/blog/grpc_on_http2 On Thursday, November 29, 2018 at 5:39:03 PM UTC-8, alan...@gmail.com wrote: > > Thanks for your suggestion, issued > . > > On

[grpc-io] Re: Measuring gRPC-Java Unary Client Requests Latency From Interceptor

2018-11-29 Thread 'Carl Mastrangelo' via grpc.io
System.currentTimeMillis() is not ideal for measuring elapsed time. It's meant for measure the current time. Instead, try doing: long startNanos = System.nanoTime(); // ... Do the RPC long stopNanos = System.nanoTime(); tick("GrpcClient.Get", TimeUnit.NANOSECONDS.toMillis(stopNanos -

[grpc-io] Re: Fail over takes too long because of TCP retransmission

2018-11-29 Thread 'Carl Mastrangelo' via grpc.io
The main way we solve this is by enabling client side keep-alives, which IIRC run once every 45 second if there are no active RPCs. These are implemented in gRPC as HTTP/2 Ping frames. I can't say I know where this is for Go, but in Java this is an actively used feature. On Monday, November

[grpc-io] Re: Binlog as a gRPC service?

2018-11-29 Thread 'Carl Mastrangelo' via grpc.io
I'm not sure that there is a service in mind, but it would need some sort of special treatment if it did exist. (i.e. do binlog gRPCs themselves get logged?) Also, what happens if the log service hangs, gets backed up, or is unreachable? On Wednesday, November 28, 2018 at 5:22:43 AM UTC-8,

[grpc-io] Re: java LB round-robin has 30 minutes blank window before re-resolve

2018-11-29 Thread 'Carl Mastrangelo' via grpc.io
Responses inline On Wednesday, November 28, 2018 at 2:23:13 PM UTC-8, eleano...@gmail.com wrote: > > Here is the test case: > > I have implemented my custom NameResolver, and using RoundRobinLoadBalancer > in managedChannelBuilder. > > 1. initially has 4 instances running (serverA, serverB,

[grpc-io] Re: gRPC over the internet at scale

2018-11-29 Thread 'Carl Mastrangelo' via grpc.io
I can't speak for most middle boxes, but at least nginx does have pretty good http2 support. I believe that is pretty common. The main issue I see with middle boxes is not supporting TLS ALPN (which HTTP/2 depends on). This is common in packet inspecting firewalls, which lag in

[grpc-io] Re: [java] - gRPC ThreadPoolExecutor and bounded queue

2018-11-29 Thread 'Carl Mastrangelo' via grpc.io
I would modify the counters before calling super (in case they throw an exception). Also, I (personally), would fail the RPCs early rather than doing resize of the pool. You can invoke call.close(Status.CANCELED), and then return a noop listener, instead of invoked methods on next. On

[grpc-io] Re: Measuring gRPC-Java Unary Client Requests Latency From Interceptor

2018-11-29 Thread 'Carl Mastrangelo' via grpc.io
That is one way. For more precise (but about as accurate) numbers, consider using a ClientStreamTracer, which you can set on the ManagedChannelBuilder. That has more fine-grained events about an RPC. On Wednesday, November 28, 2018 at 1:55:12 PM UTC-8, Yee-Ning Cheng wrote: > > I am trying

Re: [grpc-io] Thread configuration for low latency in high throughput scenario

2018-11-29 Thread 'Carl Mastrangelo' via grpc.io
+1 To what Robert said. You have a couple options here: * use ForkJoinPool, which scales much more gracefully under load. * If your RPC logic is pretty simple, and does not block (like, ever), you can use directExecutor() on the server builder and run RPCs inline. This avoids the need

[grpc-io] Re: Executing the client's send message in a separate thread?

2018-11-29 Thread 'Carl Mastrangelo' via grpc.io
Are you using Netty? If so, you can set a direct executor (using MoreExecutors.directExecutor()).For the outbound path it will involve a thread hop (see WriteQueue), but for inbound it will not. If you respond to RPCs directly on the thread that receives them, then there is no thread

[grpc-io] Re: Repeated blog article rss feed

2018-11-29 Thread 'Carl Mastrangelo' via grpc.io
I believe the RSS feed is from github.io, so you may need to file a bug there. I have emailed them in the past (their email is on the GitHub contact page), and they have been helpful to me in the past. On Tuesday, November 27, 2018 at 5:46:17 PM UTC-8, alan...@gmail.com wrote: > > Hi there, >

[grpc-io] Re: Recommended gRPC URI scheme

2018-11-29 Thread 'Carl Mastrangelo' via grpc.io
Hi Jakob! gRPC has it's own name resolution built into it's own URLs, so it may get confusing. For example, a dns based gRPC service would be dns:///localhost:9988 . Note the actual address info is in the /path/ of the URI, rather than the host or authority. For domain socket based

[grpc-io] Re: [java] - gRPC ThreadPoolExecutor and bounded queue

2018-11-29 Thread 'Carl Mastrangelo' via grpc.io
You *really* don't want to limit the queue size. The queue is not per RPC, but per RPC callback event. If the enqueue'd callback (like headers received, data received, cancellation, etc.) gets dropped, the RPC will be in a zombie state and never able to finish or die. Additionally, if you

Re: [grpc-io] How to set source ip address in grpc client application

2018-11-15 Thread 'Carl Mastrangelo' via grpc.io
I believe the original questions was for Python, not Java. There currently isn't a way to get the currently bound address in Java *except* via the Channelz service. The issue you found is a tracking issue for an experimental feature to customize connection setup. The use case is narrowly

[grpc-io] Re: How to implement asynchronous rpc in grpc?

2018-11-15 Thread 'Carl Mastrangelo' via grpc.io
Future stub is only suitable for Unary RPCs. If you look at how the stub library is implemented, BlockingStubs wrap the FutureStubs, which wrap the regular Stubs, which themselves wrap ClientCall and ServerCall. All are layers on top of the other, and get more advanced the farther down the

[grpc-io] Re: How to implement asynchronous rpc in grpc?

2018-11-14 Thread 'Carl Mastrangelo' via grpc.io
Yes. It is still async. Do be aware that flow control works slightly differently for RPCs that don't have "stream" on them (we call these "unary" RPCs). This is not usually an issue unless you are sending very fast or lots of data (like sustained Gigabits per second). On Wednesday,

[grpc-io] Re: How to implement asynchronous rpc in grpc?

2018-11-14 Thread 'Carl Mastrangelo' via grpc.io
TestServiceStub is the main asynchronous stub, and is built around the idea of the Observable / Observer pattern. RxJava uses this pattern, for instance. One thing to note, if you don't like those stubs, you can call the ClientCall and ClientCall.Listener directly. You can't use the

[grpc-io] Re: Future of github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc?

2018-11-14 Thread 'Carl Mastrangelo' via grpc.io
Maybe you can ping the author on GitHub? I'm not sure myself, but you're right there should not be two copies. On Sunday, November 11, 2018 at 3:21:35 AM UTC-8, Tom Wilkie wrote: > > Hello! > > (I'm not that familiar with the situation and couldn't find any previous > discussion of this, sorry

[grpc-io] Re: nettyserver await termination fail with spring boot

2018-11-14 Thread 'Carl Mastrangelo' via grpc.io
Can you call awaitTermination in stop()? You can use shutdownNow() also to cause a more aggressive shutdown. On Saturday, November 10, 2018 at 5:02:50 AM UTC-8, omid pourhadi wrote: > > Hi, > > I'm trying to create a spring boot app with grpc so I implemented a grpc > nettyserver to run spring

[grpc-io] Re: The version of protoc in grpcio-tools

2018-11-14 Thread 'Carl Mastrangelo' via grpc.io
I think gRPC picks the one on your PATH first IIRC. On Friday, November 9, 2018 at 3:06:48 AM UTC-8, Rui Li wrote: > > Hi team, > > I just started using gRPC recently. I wonder is there a way to > decide/control the protoc version of grpcio-tools? I'm asking because the > instructions indicate

[grpc-io] Re: gRPC performance benchmark

2018-11-06 Thread 'Carl Mastrangelo' via grpc.io
I'm not sure ab is a very good benchmark tool. It used to be years ago, but I haven't seen it used in a long time. Also, by using it you avoid the deserialization that a real client would do. On Tuesday, November 6, 2018 at 10:39:49 AM UTC-8, din...@wepay.com wrote: > > Hi, > > Using gRPC

[grpc-io] Re: gRPC & transaction support

2018-11-05 Thread 'Carl Mastrangelo' via grpc.io
I think OP hit the nail on the head with REST being a bad fit for transactions. A previous team I worked on had pretty much the same problem. There are two solutions to having transaction like semantics. 1. Make all RPCs compareAndSwap-like, effectively making them atomic operations.

Re: [grpc-io] Unable to set-up SSL on gRPC server. org/eclipse/jetty/alpn/ALPN ClassNotFound.

2018-11-05 Thread 'Carl Mastrangelo' via grpc.io
Random guess, but doesn't tcnative need to be a stonger dependency than compile? It needs to be a compile+runtime dependency. On Thursday, November 1, 2018 at 2:00:22 PM UTC-7, Jaroslav Gorskov wrote: > > EDIT: I added a -javaagent JVM argument and pointed it to ALPN. Apparently > it should be

[grpc-io] Re: Is there a way to queue RPC call in gRPC

2018-10-29 Thread 'Carl Mastrangelo' via grpc.io
What language are you using? On Sunday, October 28, 2018 at 11:30:14 PM UTC-7, deva...@gmail.com wrote: > > Hi, > > I want to limit number of threads in gRPC, I can limit it by setting > maximum number of threads. > But if there are requests in process for defined number of threads, next > RPC

Re: [grpc-io] Re: python support multi-thread

2018-10-26 Thread 'Carl Mastrangelo' via grpc.io
inting them in a multi-threaded >> way. >> >> Thank you >> ᐧ >> >> On Fri, Oct 26, 2018 at 11:46 PM 'Carl Mastrangelo' via grpc.io < >> grpc-io@googlegroups.com> wrote: >> >>> Yes it does. If you provide more information about what you want to do,

[grpc-io] Re: python support multi-thread

2018-10-26 Thread 'Carl Mastrangelo' via grpc.io
Yes it does. If you provide more information about what you want to do, we can give a better answer. On Thursday, October 25, 2018 at 9:11:49 AM UTC-7, rob.vai...@gmail.com wrote: > > hi > > I want to know Is grpc python support multi-thread? > -- You received this message because you are

[grpc-io] Re: Servers in PHP?

2018-10-25 Thread 'Carl Mastrangelo' via grpc.io
It may not be the same thing, but this was posted to twitter recently: https://github.com/spiral/php-grpc On Thursday, October 25, 2018 at 1:28:12 AM UTC-7, klingenbe...@gmail.com wrote: > > What is this lib you mention? I can't find anything in this thread > actually mentioning where one can

[grpc-io] Re: [ANDROID} OKHttp adding auth header using an interceptor

2018-10-25 Thread 'Carl Mastrangelo' via grpc.io
Take a look at MoreCallCredentials, which is how we normally do auth. https://github.com/grpc/grpc-java/blob/v1.16.0/auth/src/main/java/io/grpc/auth/MoreCallCredentials.java#L25 On Wednesday, October 24, 2018 at 12:32:44 PM UTC-7, Amilcar Andrade wrote: > > Hi All, > > I want to know what is

[grpc-io] Re: grpclb ClientStats endpoint correlation

2018-10-24 Thread 'Carl Mastrangelo' via grpc.io
The Client Stats are for the endpoint you are requesting address / load balancing info, so there's only one. I don't believe there are docs, but there is an implementation in C++ IIUC. Look up "load_reporter" (the server side) and "load_balancer" (the client side) in the grpc/grpc repo:

Re: [grpc-io] What is the relation between :authority and channel credentials?

2018-10-24 Thread 'Carl Mastrangelo' via grpc.io
The authority is available to the channel credentials when the creds are being created. As you noticed, the authority is used to verify the identity in TLS, and allows the server to route your request . Does this answer your question? On Wednesday, October 24, 2018 at 2:07:08 AM UTC-7,

[grpc-io] Re: Load Balance secure connection

2018-10-17 Thread 'Carl Mastrangelo' via grpc.io
Expanding on this answer further > The data passes through the said proxy. Ok, so that makes sense. So basically: + --> B1 | C ---> P --> B2 | + --> B3 If this diagram doesn't get broke, the issue you have is that the Proxy can't have access to the certs but

[grpc-io] Re: Handshake failed with fatal error SSL_ERROR_SSL: error:14090086:SSL

2018-10-17 Thread 'Carl Mastrangelo' via grpc.io
Two immediate questions;: Did you swap the order of the root cert and the my_cert? When I used openssl verify I had to swap the order. Normally I would call the CA cert the root. I think you need to rename the two certs to each other. The authority you connect to in your client needs to

[grpc-io] Re: Load Balance secure connection

2018-10-16 Thread 'Carl Mastrangelo' via grpc.io
There are a few options. The key words to look for are "L7" loadbalancing and "L4" loadbalancing. For L7, your entry point to the load balancer, typically some kind of reverse proxy, decodes the TLS and then forwards the traffic to the correct backend. Your client sends traffic to the proxy

[grpc-io] Re: Zuul API gateway and GRPC java

2018-10-15 Thread 'Carl Mastrangelo' via grpc.io
Hi, I don't think we have domain expertise with Zuul here. If you are using Java, the load balancer is pluggable, and you can define your own load balancing policy. On Saturday, October 13, 2018 at 8:28:54 AM UTC-7, Isuru Samaraweera wrote: > > Hi All, > Can we expose a single grpc

[grpc-io] Re: grpc Thread pools question

2018-10-04 Thread 'Carl Mastrangelo' via grpc.io
yes, you can call ManagedChannelBuilder.executor() and ServerBuilder.executor(). I don't have any examples off hand, but we personally prefer using ForkJoinPool as our executor. On Thursday, October 4, 2018 at 8:06:48 AM UTC-7, cr2...@gmail.com wrote: > > Should have added I'm only interested

  1   2   3   4   >