Aeron 是如何实现的?—— Ipc 异常情况处理

接上文

《Aeron是什么?》

《Aeron中这么多空闲策略选哪个?》

《Aeron是如何实现的?—— Conductor》

《Aeron 是如何实现的?—— Ipc Publication》

《Aeron 是如何实现的?—— Ipc Subscription》

0. 简介

上文分析了 Ipc Subscription 的逻辑,本文继续分析一下 ipc 场景异常情况处理。

1. 两个心跳

总的来说,Client 与 Driver 之间是通过心跳超时判断对方是否异常。

  1. Client 周期性检查 Driver 是否超过 driverTimeoutMs 没有心跳。

  2. Driver 周期性检查 Client 是否超过 clientLivenessTimeoutMs 没有心跳。

Driver 没有心跳是个严重的问题,Client 默认将会自杀;Client 没有心跳,Driver 将会把相关的资源(pub 和 sub 关系等)关闭。下面详细看一下。

2. Client Conductor

<
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Aeron 提供高效可靠的单播和多播消息传输机制。相关技术术语:传输介质: 可通过UDP、InfiniBand、共享内存等介质驱动: Driver for read/writing to/from transmission media for Aeron.发布者: This is the client application which emits messages.发送者: The media driver which sends the messages produced by the client publisher.接收者: The media driver which receives messages send by the Sender.订阅者: The client application which is receiving messages.驱动订阅 Driver Subscription: The media driver in charge of message receipt. These messages are passed on to client Subscription applications.会话 Session: A unique invocation of Aeron that identifies a single Publication and all Subscriptions for that Publication.会话ID Session ID: A unique identifier for a Session.频道 Channel: A transmission media needs to have a means of identifying a flow of data and the addressing model of the media. For Aeron, this is called a Channel. For different transmission media, the channel is defined differently. In general, a URI is used for specifying a channel.物理来源 Physical Source: Source of a Session.物理接收者 Physical Receiver: Receiver of a Session.流 Stream: A Session carries sub-sessions within it. Streams are these sub-sessions.流ID Stream ID: A unique identifier for a Stream. A value of 0 is reserved.Term: A section of data within a Stream. Each Term is associated with a Media Driver send and receive buffer. The length of a Term must be a factor of two and must be the same length on both ends.Term ID: A unique identifier for a Term within a Stream. Starts randomly. Must increase monotonically. Can wrap around. Can not go back to a wrapped value.Term Offset: Identifier of a single byte within the Term. Always start at 0. This is the number of the byte within a given term starting from the beginning.Frame: The unit of data for Aeron. Measured in bytes. The transmission media may include multiple Frames into a single packet of data for batching.Message (aka APDU): The unit of data for the application. APDU means APplication Data Unit. A single Message may be fragmented over multiple Frames. Alternatively, a single Message may fit into a single Frame. A message, all of its fragments, must fit into a single Term.Fragment: The unit of data for a fragmented Message that fits into a single Frame. 标签:Aeron

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值