Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[EventHubs] A server-busy rejection tears down the whole connection on every retry

オープン 初心者向け
#7,333 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
86/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
cpp

調査の方向性

sdk/eventhubs/azure-messaging-eventhubs/src/private/eventhubs_utilities.hpp の ShouldInvalidateSender から始め、既存の message-size-exceeded の keep-list エントリを確認してください。次に sdk/eventhubs/azure-messaging-eventhubs/test/ut/reattach_policy_test.cpp とその真理値表を調べてください。server-busy 条件で sender が維持され、更新された reattach policy テストがパスすれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Client Event Hubs needs-team-attention Service Attention

Summary

A com.microsoft:server-busy rejection discards the cached sender, the session, and the connection for the partition. So every retry of a throttled send pays a full TCP, TLS, SASL, CBS, and attach round trip, at the moment when the service asked for less load.

Motivation

ShouldInvalidateSender keeps the cached sender for one condition only, amqp:link:message-size-exceeded (sdk/eventhubs/azure-messaging-eventhubs/src/private/eventhubs_utilities.hpp:111-114). Every other condition returns true.

ProducerClient::Send calls that helper in its catch block, and a true result calls InvalidateSender (sdk/eventhubs/azure-messaging-eventhubs/src/producer_client.cpp:200-207). InvalidateSender closes and removes the sender, the session, and the connection for that partition id, so the next attempt builds all three again.

AmqpErrorCondition::ServerBusyError holds the value com.microsoft:server-busy (sdk/core/azure-core-amqp/src/models/amqp_error.cpp:152; the declaration is at sdk/core/azure-core-amqp/inc/azure/core/amqp/internal/models/amqp_error.hpp:175). EventHubsExceptionFactory::IsErrorTransient lists that condition as transient (sdk/eventhubs/azure-messaging-eventhubs/src/eventhubs_utilities.cpp:133-145), so RetryOperation::Execute retries the send.

The service reports this condition on the disposition of the transfer, and it keeps the link attached. That reply arrives on the same path as the message size rejection: the uAMQP sender maps a rejected delivery state to MessageSendStatus::Error and it gives the AMQP error back in the send tuple (sdk/core/azure-core-amqp/src/impl/uamqp/amqp/message_sender.cpp:507-523), and Send turns that tuple into an EventHubsException (sdk/eventhubs/azure-messaging-eventhubs/src/producer_client.cpp:177-185). The message size case is already on the keep list for exactly this reason. The server busy case has the same shape and is not on the list.

The .NET producer keeps its link in a FaultTolerantAmqpObject<SendingAmqpLink> and it builds a new link when that object faults (AmqpProducer.cs). A rejected disposition does not fault the link object, so .NET keeps the link and retries the transfer on it.

This behaviour became visible with #7328, which is the link reattach part of #7254. Before that change, a failed send left the cached sender in place.

Proposal

Add AmqpErrorCondition::ServerBusyError to the keep list in ShouldInvalidateSender, next to amqp:link:message-size-exceeded. Compare against the constant, and not against a literal string, so the two spellings cannot drift apart.

Extend the truth table in sdk/eventhubs/azure-messaging-eventhubs/test/ut/reattach_policy_test.cpp with a com.microsoft:server-busy row that asserts that the sender stays.

Note that the server busy delay is a separate item in #7254, and it stays out of scope here. This change covers the link only.

主要言語
C++
スター
207
フォーク
173
平均マージ
1日 10時間
マージ済み PR(30日)
30

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Azure/azure-sdk-for-cpp のほかの issue

Azure/azure-sdk-for-cpp の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。