Re: [grpc-io] How to send an application specific error code to clients in grpc-java

2019-12-11 Thread Hiroyuki Yamada
Hi Eric,

Thank you very much for the quick response.
Yes, I thought so, but asRuntimeException(metadata) is an experimental API
so I was wondering if there is another better way.
(Seems like StatusProto is also experimental)

Could you (or anyone) give me a hint of how much I can rely on the
experimental APIs for our production use ?
Are they going to be changed quite surely ?

Thanks,
Hiro


On Thu, Dec 12, 2019 at 3:33 AM Eric Anderson  wrote:
>
> You can provide additional details in the Metadata, which can be attached to 
> a StatusException/StatusRuntimeException. You would define a proto message to 
> hold the specific details you care about and then pass it in the Metadata 
> directly on in a google.rpc.Status. See 
> https://stackoverflow.com/a/48750825/4690866 for how that looks.
>
> On Tue, Dec 10, 2019 at 7:41 PM  wrote:
>>
>> Hello,
>>
>> I'm wondering how I can send an application specific error code to clients 
>> in grpc-java.
>>
>> I've been using gprc-java for a few years, but I haven't used onError api in 
>> a server
>> since there seems no way to return application specific error status/code to 
>> a client.
>> (Unless I serialize the code to String and pass it through description or 
>> something)
>>
>> It would be great if experts can give me some advice for this.
>>
>> Thanks,
>> Hiro
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "grpc.io" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to grpc-io+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/grpc-io/9a02e7f4-25ea-4943-8d0e-987122a99e02%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/CAPDOW77etdLtkucShviWT%2BaXyjNd199JN4ufu-gxdq54GL9_CQ%40mail.gmail.com.


Re: [grpc-io] How to send an application specific error code to clients in grpc-java

2019-12-11 Thread 'Eric Anderson' via grpc.io
You can provide additional details in the Metadata, which can be attached
to a StatusException/StatusRuntimeException. You would define a proto
message to hold the specific details you care about and then pass it in the
Metadata directly on in a google.rpc.Status. See
https://stackoverflow.com/a/48750825/4690866 for how that looks.

On Tue, Dec 10, 2019 at 7:41 PM  wrote:

> Hello,
>
> I'm wondering how I can send an application specific error code to clients
> in grpc-java.
>
> I've been using gprc-java for a few years, but I haven't used onError api
> in a server
> since there seems no way to return application specific error status/code
> to a client.
> (Unless I serialize the code to String and pass it through description or
> something)
>
> It would be great if experts can give me some advice for this.
>
> Thanks,
> Hiro
>
> --
> You received this message because you are subscribed to the Google Groups "
> grpc.io" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to grpc-io+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/grpc-io/9a02e7f4-25ea-4943-8d0e-987122a99e02%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/CA%2B4M1oPUQqBwc3818pmUfRMq6iTp-OjzeO1g%3DBAKaeSe7iQ72w%40mail.gmail.com.


smime.p7s
Description: S/MIME Cryptographic Signature


Re: [grpc-io] Optimizing gRPC for localhost

2019-12-11 Thread 'Srini Polavarapu' via grpc.io
Currently there is no plan to do this and I don't think it has a lot of 
value. One option is to write your own interceptors on both sides to bypass 
HTTP/2 stack. You'll have to handle deadlines, flow control, multiplexing 
etc. on your own. Essentially, you'll be implementing your own transport 
between the two processes. 

On Wednesday, December 11, 2019 at 9:46:48 AM UTC-8, Andrey Tcherepanov 
wrote:
>
> Any plans to look into that, or it is not of any importance?
>
> On Tuesday, December 10, 2019 at 8:14:37 AM UTC-7, Nicolas Noble wrote:
>>
>> We don't have that sort of optimization at the moment, no. Even if you 
>> use unix domain sockets, it still go through the whole process. 
>>
>> On Mon, Dec 9, 2019 at 10:56 PM Gautham Banasandra  
>> wrote:
>>
>>> Hi all,
>>>
>>> I'm using gRPC to communicate between a go and C++ process running on 
>>> the same node. The C++ process hosts the gRPC server and the go process is 
>>> the client. The go process makes a lot of gRPC calls hosted by the gRPC 
>>> server in the C++ process in a blocking manner.
>>> I collected a CPU profile (see below) of the go process and I see that 
>>> about 50% of CPU is spent in gRPC. Out of which, only about 20% is spent in 
>>> I/O. I assume that the remaining 30% is spent in marshalling/unmarshalling 
>>> the messages. Given that all the communications is going to be limited to 
>>> just one node, is there any way that I could tune gRPC to get better 
>>> performance? For example, is there a way to avoid the overhead in 
>>> constructing HTTP2 messages? Essentially, what I'm looking for is a way to 
>>> use gRPC for Inter Process Communication.
>>>
>>> [image: cpu profile.jpg]
>>> Thanks,
>>> --Gautham
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "grpc.io" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to grp...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/grpc-io/4aa144cb-587b-4286-8832-cad1528ca12b%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/434399a5-3e04-4fc6-b2de-761242217de4%40googlegroups.com.


Re: [grpc-io] Optimizing gRPC for localhost

2019-12-11 Thread Andrey Tcherepanov
Any plans to look into that, or it is not of any importance?

On Tuesday, December 10, 2019 at 8:14:37 AM UTC-7, Nicolas Noble wrote:
>
> We don't have that sort of optimization at the moment, no. Even if you use 
> unix domain sockets, it still go through the whole process. 
>
> On Mon, Dec 9, 2019 at 10:56 PM Gautham Banasandra  > wrote:
>
>> Hi all,
>>
>> I'm using gRPC to communicate between a go and C++ process running on the 
>> same node. The C++ process hosts the gRPC server and the go process is the 
>> client. The go process makes a lot of gRPC calls hosted by the gRPC server 
>> in the C++ process in a blocking manner.
>> I collected a CPU profile (see below) of the go process and I see that 
>> about 50% of CPU is spent in gRPC. Out of which, only about 20% is spent in 
>> I/O. I assume that the remaining 30% is spent in marshalling/unmarshalling 
>> the messages. Given that all the communications is going to be limited to 
>> just one node, is there any way that I could tune gRPC to get better 
>> performance? For example, is there a way to avoid the overhead in 
>> constructing HTTP2 messages? Essentially, what I'm looking for is a way to 
>> use gRPC for Inter Process Communication.
>>
>> [image: cpu profile.jpg]
>> Thanks,
>> --Gautham
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "grpc.io" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to grp...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/grpc-io/4aa144cb-587b-4286-8832-cad1528ca12b%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/e2a84e0a-7856-4484-8574-07b05d90bd22%40googlegroups.com.