Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

RabbitMQ subscription never reports transport death to the supervisor

未关闭
#575 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 7 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
1-2 天
新手友好度
53/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
冷清
技术栈
csharp, rabbitmq
领域
backend

调研方向

Read the subscription lifecycle changes in #571 and inspect RabbitMqSubscription.Connect, especially how other transports map shutdown events to run.Fail. Trace the RabbitMQ channel, connection, and consumer shutdown signals and decide how automatic recovery should interact with supervisor resubscription. Done means transport death is reported once, clean teardown is not reported as a drop, and the behavior is covered for the relevant shutdown cases.

由索引模型根据 Issue 内容生成。

描述

Context

#571 rebuilt the subscription lifecycle around a supervisor loop: each connect attempt gets a SubscriptionRun, and a transport signals its death via run.Fail(...) so the supervisor can tear the run down and resubscribe. Every transport follows this contract except RabbitMQ.

RabbitMqSubscription.Connect wires only consumer.ReceivedAsync. Consumer cancellation, channel shutdown, and connection shutdown are never mapped to run.Fail, so when the broker cancels the consumer or the channel/connection dies for good (notably with automatic recovery disabled, or when recovery gives up), run.Ended never completes: the supervisor stays parked, no drop is reported, health stays green, and the subscription consumes nothing until the host restarts.

This is not a regression from #571 — the previous implementation never called Dropped for RabbitMQ either, which is why it was split out of that PR (it surfaced during its review). c061dd79 in #571 fixed the adjacent case of handler failures being swallowed under ThrowOnError; this issue covers transport-level death.

Suggested direction

In Connect, map the client's shutdown signals to the run:

  • IChannel.ChannelShutdownAsync
  • IConnection.ConnectionShutdownAsync
  • consumer cancellation/unregistration on AsyncEventingBasicConsumer

each calling run.Fail(DropReason.ServerError, ...) — but only when the shutdown isn't the run's own teardown (guard on run.Token.IsCancellationRequested, as the other transports do), so a clean stop isn't double-reported.

The interaction with the client's automatic recovery (on by default in ConnectionFactory) needs a decision: a recoverable shutdown may be healed by the client without a resubscribe, so either

  1. treat any shutdown as a drop and let the supervisor own recovery (simple, predictable, matches the other transports), or
  2. only fail the run on shutdowns the client reports as non-recoverable, and keep relying on auto-recovery for the rest.

Option 1 is likely the right default; relying on auto-recovery means the supervisor never learns the transport flapped, and per-run state (sequence, checkpoint handler) silently spans reconnects.

Refs: #571

主要语言
C#
星标
512
派生
99
平均合并
5 天 6 小时
30 天内合并 PR
5

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Eventuous/eventuous 的其他 Issue

查看 Eventuous/eventuous 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。