grpc_insecure_channel_create DNS and connection expectations

26 views
Skip to first unread message

Pau Freixes

unread,
Feb 24, 2019, 1:04:06 PM2/24/19
to grpc.io
Hi,

Reading the source code of `grpc_insecure_channel_create` [1] seems
that this function must trigger in some way the DNS query for the
target and also the first connection handshake asynchronously

Executing one of the Python examples seems that the DNS resolution and
the connection are not really done until at least one request is
executed [2].

Am I missing something?

If not, is this is the default implementation? So other languages like
C++, Java, Node.js are using the same pattern?

Does the API provide a way of making the connection step explicitly?

[1] https://github.com/grpc/grpc/blob/8860eb34ab9183589a039a36a6e10a74b440c501/src/core/ext/transport/chttp2/client/insecure/channel_create.cc#L82
[2] https://github.com/grpc/grpc/blob/master/examples/python/helloworld/greeter_client.py#L31

--
--pau

yas...@google.com

unread,
Feb 27, 2019, 1:48:25 PM2/27/19
to grpc.io
I am speaking from a Core/C++ perspective. Simply creating a channel does not lead to connection attempts. It's the first RPC or an explicit connect request that triggers it.

Pau Freixes

unread,
Feb 28, 2019, 12:27:15 AM2/28/19
to yas...@google.com, grpc.io
Thanks, that is was I suspect.
IMO the docstring in the code for the `grpc_insecure_channel_create`
must be modified , now it can lead to some misunderstanding
> --
> 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+u...@googlegroups.com.
> To post to this group, send email to grp...@googlegroups.com.
> Visit this group at https://groups.google.com/group/grpc-io.
> To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/8943b3cf-7bf9-46a9-876e-63dc374be0c3%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
--pau
Reply all
Reply to author
Forward
0 new messages