Unary模式下客户端创建 default-executor 和 resolver-executor 线程和从启动到执行grpc_connector_connect的主要流程
(原创)C/C语言, 平台是debian10, grpc版本:grpc-c/1.25.0-dev grpc-c/8.0.0, 使用的例子是自带的例子GreeterClient
创建 default-executor 和 resolver-executor 线程的主要流程,创建channel时会创建这2个线程
000(grpc::InsecureChannelCredentials #credentials.h:91 调用InsecureChannelCredentials)-->001(grpc_impl::InsecureChannelCredentials #insecure_credentials.cc:59 创建一个共享的InsecureChannelCredentialsImpl对象)
001-->002(grpc_impl::InsecureChannelCredentialsImpl::InsecureChannelCredentialsImpl #insecure_credentials.cc:30 调用父类ChannelCredentials构造函数)
002-->003(grpc_impl::ChannelCredentials::ChannelCredentials #credentials_cc.cc:25 调用父类GrpcLibraryCodegen构造函数)
003-->004(grpc::GrpcLibraryCodegen::GrpcLibraryCodegen #grpc_library.h:45 调用GrpcLibraryInterface的init)
004-->005(grpc::internal::GrpcLibrary::init #grpc_library.h:34 调用grpc_init)
005-->006(grpc_init #init.cc:146 调用grpc_iomgr_init)
006-->007(grpc_iomgr_init #iomgr.cc:60 调用grpc_core::Executor::InitAll)
007-->008(创建 default-executor 和 resolver-executor 线程)
008-->009(grpc_iomgr_start #iomgr.cc:69 调用grpc_timer_manager_init)
009-->010(grpc_timer_manager_init #timer_manager.cc:311 调用start_threads)
010-->011(start_threads #timer_manager.cc:293 调用start_timer_thread_and_unlock)
011-->012(start_timer_thread_and_unlock #timer_manager.cc:91 启动grpc_global_timer线程)
grpc Unary模式下客户端启动到执行grpc_connector_connect的主要流程
000(grpc::internal::BlockingUnaryCall #client_unary_call.h:43)-->001(grpc::internal::BlockingUnaryCallImpl::BlockingUnaryCallImpl #client_unary_call.h:71 创建CompletionQueue, Call, CallOpSet对象, 设置CallOpSet对象参数, 调用PerformOps)
001-->002(grpc::internal::Call::PerformOps #call.h:69 调用PerformOpsOnCall)
002-->003(grpc_impl::Channel::PerformOpsOnCall #channel_cc.cc:164 调用FillOps)
003-->004(grpc::internal::CallOpSet::FillOps #call_op_set.h:874 调用ContinueFillOpsAfterInterception)
004-->005(grpc::internal::CallOpSet::ContinueFillOpsAfterInterception #call_op_set.h:943 调用6个op的AddOp并调用grpc_call_start_batch)
005-->006(grpc::CoreCodegen::grpc_call_start_batch #core_codegen.cc:113 调用grpc_call_start_batch)
006-->007(grpc_call_start_batch #call.cc:1974 调用call_start_batch)
007-->008(call_start_batch #call.cc:1929 根据6个ops的op->op, 设置stream_op, ops, call的参数, 最后调用execute_batch)
008-->009(execute_batch #call.cc:639 调用start_batch_closure的callback函数 execute_batch_in_call_combiner)
009-->010(execute_batch_in_call_combiner #call.cc:628 调用 elem->filter->start_transport_stream_op_batch)
010-->011(grpc_call_next_op #channel_stack.cc:227 调用 next_elem->filter->start_transport_stream_op_batch)
011-->012(grpc_core::CallData::StartTransportStreamOpBatch #client_channel.cc:2140 把batch加入pending:PendingBatchesAdd并调用PickSubchannel)
012-->013(grpc_core::CallData::PickSubchannel #client_channel.cc:3853 调用PickSubchannelLocked返回false)
013-->014(grpc_core::CallData::PickSubchannelLocked #client_channel.cc:3870 picker_是nullptr, 调用CheckConnectivityState, 参数设定为尝试连接)
014-->015(grpc_core::ChannelData::CheckConnectivityState #client_channel.cc:1956 创建closure并调用它的callback函数 TryToConnectLocked)
015-->016(closure_impl::closure_wrapper #closure.h:156 创建closure是callback函数是closure_impl::closure_wrapper, 真正的callback是 TryToConnectLocked)
016-->017(grpc_core::ChannelData::TryToConnectLocked #client_channel.cc:1946 调用CreateResolvingLoadBalancingPolicyLocked)
017-->018(grpc_core::ChannelData::CreateResolvingLoadBalancingPolicyLocked #client_channel.cc:1596 调用ResolvingLoadBalancingPolicy构造函数)
018-->019(grpc_core::ResolvingLoadBalancingPolicy #resolving_lb_policy.cc:199 创建CreateResolver, UpdateState并调用StartLocked开始解析)
019-->020(grpc_core::AresDnsResolver::StartLocked #dns_resolver_ares.cc:177 调用MaybeStartResolvingLocked)
020-->021(grpc_core::AresDnsResolver::MaybeStartResolvingLocked #dns_resolver_ares.cc:409 调用StartResolvingLocked)
021-->022(grpc_core::AresDnsResolver::StartResolvingLocked #dns_resolver_ares.cc:420 调用grpc_dns_lookup_ares_locked)
022-->023(grpc_dns_lookup_ares_locked_impl #grpc_ares_wrapper.cc:625 调用grpc_dns_lookup_ares_continue_after_check_localhost_and_ip_literals_locked)
023-->024(grpc_dns_lookup_ares_continue_after_check_localhost_and_ip_literals_locked #grpc_ares_wrapper.cc:446 使用c-ares通过dns查找ip地址, 最后调用grpc_ares_request_unref_locked)
024-->025(grpc_ares_request_unref_locked #grpc_ares_wrapper.cc:135 如果延迟的查询为0, 调用grpc_ares_ev_driver_on_queries_complete_locked)
025-->026(grpc_ares_ev_driver_on_queries_complete_locked #grpc_ares_ev_driver.cc:191 停止查询,调用grpc_timer_cancel, 参数是query_timeout)
026-->027(grpc_timer_cancel #timer.cc:35 调用grpc_timer_impl->cancel)
027-->028(timer_cancel #timer_generic.cc:474 调用 timer->closure对应的callback函数)
028-->029(on_ares_backup_poll_alarm_locked #grpc_ares_ev_driver.cc:288 调用grpc_ares_ev_driver_unref)
029-->030(grpc_ares_ev_driver_unref #grpc_ares_ev_driver.cc:112 释放资源并调用grpc_ares_complete_request_locked)
030-->031(grpc_ares_complete_request_locked #grpc_ares_wrapper.cc:151 调用on_done对应的callback函数)
031-->032(grpc_core::AresDnsResolver::OnResolvedLocked #dns_resolver_ares.cc:347 解析完成, 调用ReturnResult)
032-->033(grpc_core::ResolvingLoadBalancingPolicy::ResolverResultHandler::ReturnResult #resolving_lb_policy.cc:87 调用OnResolverResultChangedLocked)
033-->034(OnResolverResultChangedLocked #resolving_lb_policy.cc:479 获得lb_policy_name,默认pick_first, 如果lb_policy_name不为空, 则创建或者更新LB policy, 调用的是CreateOrUpdateLbPolicyLocked)
034-->035(CreateOrUpdateLbPolicyLocked #resolving_lb_policy.cc:364 创建或者更新lb_policy, 调用UpdateLocked)
035-->036(PickFirst::UpdateLocked #pick_first.cc:280 调用AttemptToConnectUsingLatestUpdateArgsLocked)
036-->037(PickFirst::AttemptToConnectUsingLatestUpdateArgsLocked #pick_first.cc:236 用latest_update_args_创建 subchannel列表, 如果列表中的subchannel有状态是GRPC_CHANNEL_READY, 则选中此subchannel, 否则选中第0个subchannel)
037-->038(AttemptToConnect #client_channel.cc:921 调用subchannel_->AttemptToConnect)
038-->039(Subchannel::AttemptToConnect #subchannel.cc:823 调用MaybeStartConnectingLocked)
039-->040(Subchannel::MaybeStartConnectingLocked #subchannel.cc:930 调用ContinueConnectingLocked)
040-->041(Subchannel::ContinueConnectingLocked #subchannel.cc:983 设置grpc_connect_in_args参数并调用grpc_connector_connect, 通过connector->vtable->connect最后调用chttp2_connector_connect)
Unary模式下客户端创建 default-executor 和 resolver-executor 线程和从启动到执行grpc_connector_connect的主要流程的更多相关文章
- grpc Unary模式下客户端创建insecure channel的主要流程
(原创)C/C/1.25.0-dev grpc-c/8.0.0, 使用的例子是自带的例子GreeterClient grpc Unary模式下客户端创建insecure channel的主要流程 gr ...
- Unary模式下客户端从开始连接到发送接收数据的主要流程
(原创)C/C/1.25.0-dev grpc-c/8.0.0, 使用的例子是自带的例子GreeterClient grpc Unary模式下客户端从开始连接到发送数据的主要流程 graph TD; ...
- 烂泥:openvpn tun模式下客户端与内网机器通信
本文由秀依林枫提供友情赞助,首发于烂泥行天下 前两篇文章我们介绍了有关openvpn的搭建与配置文件的讲解,这篇文章我们再聊介绍下,在tun模式下openvpn客户端如何与内网机器通信的问题. 一.实 ...
- Azure ARM (11) ARM模式下,创建虚拟机并配置负载均衡器
<Windows Azure Platform 系列文章目录> 本文内容比较多,请大家仔细阅读,谢谢! 在前几章中,我们做了准备工作: 1.创建ARM Resouce Group,叫Lei ...
- 【案例分享】使用ActiveReports报表工具,在.NET MVC模式下动态创建报表
提起报表,大家会觉得即熟悉又陌生,好像常常在工作中使用,又似乎无法准确描述报表.今天我们来一起了解一下什么是报表,报表的结构.构成元素,以及为什么需要报表. 什么是报表 简单的说:报表就是通过表格.图 ...
- Azure ARM (9) 创建ARM模式下的虚拟机网络
<Windows Azure Platform 系列文章目录> 笔者在之前几章内容中,创建了ARM Resource Group,然后在这个ARM Resource Group下创建Azu ...
- ARM模式下创建Express Route
在Azure的ARM模式下,创建Express Route的命令和ASM模式下是有一些区别的. 本文将介绍在ARM模式下,如果创建Express Route的Circuit. 1. 查看支持的Serv ...
- ASP.NET Core3.1使用IdentityServer4中间件系列随笔(五):创建使用[Code-授权码]授权模式的客户端
配套源码:https://gitee.com/jardeng/IdentitySolution 本篇将创建使用[Code-授权码]授权模式的客户端,来对受保护的API资源进行访问. 1.接上一篇项目, ...
- Nginx+Docker部署模式下 asp.net core 获取真实的客户端ip
目录 Nginx+Docker部署模式下 asp.net core 获取真实的客户端ip 场景 过程还原 结论 参考资料 Nginx+Docker部署模式下 asp.net core 获取真实的客户端 ...
随机推荐
- bugku——蹭网先解开密码(EWSA,hashcat破解wifi握手包)
题目地址:http://ctf.bugku.com/files/77decd384a172b9a2294e6c6acfd48cc/wifi.cap 下载是个.cap的文件,破解过wifi的童鞋肯定知道 ...
- webrtc (6) 在Webrtc中集成VideoToolbox
来源:http://blog.csdn.net/wangruihit/article/details/46550853 VideoToolbox是iOS平台在iOS8之后开放的一个Framework, ...
- SAP云平台和第三方CRM解决方案(火锅)互联
光看封面配图,这篇文章很容易被误认为在讲成都的美食之一:火锅. SAP成都研究院坐落在被联合国教科文组织授予过"美食之都"称号的成都,所在的天府软件园,半径1公里左右星罗棋布着很多 ...
- asp.net core ServiceProvider
针对每次请求所使用的ServiceProvider依然是WebHost的ServiceProvider吗? 对于某个由ServiceProvider提供的服务对象说,针对它的回收也是由这个Servic ...
- itextpdf使用中文字体的三种方式
使用itextpdf时,默认的字体没有中文,总结了一下使用中文字体的方式. 1.使用windows系统下的字体,该种方式的具体操作可以看另一篇博客:https://www.cnblogs.com/wh ...
- 通过async与await实现高效并发
withTimeoutOrNull: 在上一次https://www.cnblogs.com/webor2006/p/12010388.html中对于协程的超时机制进行了一个学习,上次用的是withT ...
- python接口自动化17-multipart/form-data表单提交
前言 multipart/form-data这种格式官方文档给的参考案例比较简单,实际情况中遇到会比较复杂,本篇讲解multipart/form-data的表单如何提交,非图片上传 禅道提交bug 1 ...
- LengthFieldBasedFrameDecoder
LengthFieldBasedFrameDecoder 详解 疯狂创客圈 Java 分布式聊天室[ 亿级流量]实战系列之 -31[ 博客园 总入口 ] 文章目录 LengthFieldBasedFr ...
- c语言中的数据类型的最大最小值
#include <float.h>#include <limits.h> int n1 = INT_MIN;int n2 = INT_MAX;float f1 = F ...
- 【可持久化0/1Trie】【P4735】最大异或和
Description 给定一个长度为 \(n\) 的序列 \(A\),有 \(m\) 次操作,每次要么在序列尾部再添加一个数,将序列长度 \(n\) 加一,要么给进行一次查询,给定查询参数 \(l, ...