WS9: Restore the receiver prefetch option on the Rust AMQP transport
Los mantenedores suelen responder en 1 día
@j7nw4r ya está trabajando en esto.
Desde el 2/8/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Summary
The Rust AMQP transport ignores the receiver prefetch option. PartitionClientOptions::Prefetch and ProcessorOptions::Prefetch are public options. Their documented default is 300, and a negative value disables the prefetch. The Event Hubs client copies these options into MessageReceiverOptions::MaxLinkCredit. The uAMQP transport sends that value to the wire. The Rust transport does not read it. Each receiver link therefore attaches with the Rust crate default of 100 credits.
The Rust transport is the default transport today (sdk/core/azure-core-amqp/CMakeLists.txt:36). A default build therefore has a public option that does nothing.
The AMQP transport decision in #7253 gates this item. The severity tags below apply if that decision selects the Rust transport. If the decision selects the uAMQP transport, this item closes with no code change. The severity tags follow the key in #7252. All code anchors refer to commit f1039fe23.
Motivation
AMQP link flow control is receiver driven. The receiver grants the link credit. The sender must stop when the credit becomes zero. The prefetch option sets that credit. It controls how many events the service sends before the client grants more credit.
The Event Hubs client sets the credit in both transport branches. src/partition_client.cpp:130-133 and :162-167 each contain the comment "Set the link credit to the prefetch count". Each branch assigns receiverOptions.MaxLinkCredit = options.Prefetch. The documented default is 300 (inc/azure/messaging/eventhubs/partition_client.hpp:50, inc/azure/messaging/eventhubs/processor.hpp:61).
The uAMQP receiver sends the value to the wire. src/impl/uamqp/amqp/message_receiver.cpp:121-123 tests m_options.MaxLinkCredit != 0. It then calls m_link->SetMaxLinkCredit.
The Rust receiver discards the value. MessageReceiverImpl::Open sets the name, the receiver settle mode, the target, and the properties. It then calls amqpmessagereceiver_attach (src/impl/rust_amqp/amqp/message_receiver.cpp:131-178). It never sets the credit. The MaxLinkCredit field stays commented out at src/impl/rust_amqp/amqp/message_receiver.cpp:129.
The Rust crate default reaches the wire instead. rust_amqp/azure_core_amqp/src/fe2o3/receiver.rs:59 calls options.credit_mode.clone().unwrap_or_default(). rust_amqp/azure_core_amqp/src/receiver.rs:32-34 sets that default to ReceiverCreditMode::Auto(100).
The three documented behaviors therefore become one fixed value of 100 credits on a default build:
| Documented behavior | The uAMQP transport | The Rust transport |
|---|---|---|
Prefetch has a default of 300 |
300 credits | 100 credits |
Prefetch has a value of N |
N credits | 100 credits |
A Prefetch value below 0 disables the prefetch |
the uAMQP default applies | 100 credits |
Both sides of the language boundary have the necessary capability. Only the call between them is missing. The FFI exports amqpmessagereceiveroptions_set_credit_mode (rust_amqp/rust_wrapper/src/amqp/message_receiver.rs:382). That function accepts a RustReceiverCreditMode { manual: bool, credit_mode: u32 } (:375-379). It then sets ReceiverCreditMode::Manual or ReceiverCreditMode::Auto(n). No C++ code calls this function.
The impact is silent. A caller who increases Prefetch to adjust the receive throughput sees no change. A caller who sets Prefetch below zero to disable the prefetch still receives events. The library reports no error to either caller. No test finds the difference.
One related item needs an examination, but not a fix in this issue. The FFI also exports amqpmessagereceiveroptions_set_auto_accept. No C++ code calls that function either.
Proposal
- Set the credit mode in
MessageReceiverImpl::Openon the Rust transport (src/impl/rust_amqp/amqp/message_receiver.cpp:131-178). The FFI entry point exists already. [GA blocker] - Delete the commented
MaxLinkCreditfield atsrc/impl/rust_amqp/amqp/message_receiver.cpp:129. [GA blocker] - Decide how
MessageReceiverOptions::MaxLinkCreditshows a disabled prefetch, and record the decision in this issue. The C++ option is auint32_twith a default of 0.src/partition_client.cpp:130assigns it only whenPrefetchis 0 or more. A disabled prefetch is therefore the same as an option that the caller did not set. The Rust side shows the disabled condition asReceiverCreditMode::Manual. [GA blocker] - Examine the Rust receiver shim for more options that
Opendiscards. Start with the auto accept option. [GA blocker] - Add an offline test that makes sure the receiver attaches with the requested credit. This test is cheap, and it finds this defect. [GA blocker]
- Make the two transport branches at
src/partition_client.cpp:128-133,162-167agree after the fix. #7253 can also remove one of the two branches. [GA quality bar] - Add a live test that shows a different
Prefetchvalue changes the receive behavior. [GA quality bar]
Validation
- A receiver with the default options attaches with 300 credits on the transport that #7253 selects.
- A receiver with a custom
Prefetchvalue attaches with that value. - A receiver with a
Prefetchvalue below zero operates as the recorded decision states. - The offline credit test passes. This test fails today on the Rust transport, and it must pass after the fix.
- The path from the Event Hubs client to the wire discards no other
MessageReceiverOptionsfield.
- Lenguaje dominante
- C++
- Estrellas
- 206
- Forks
- 178
- Merge medio
- 2 d 15 h
- PR fusionados (30 d)
- 33
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Azure/azure-sdk-for-cpp
-
bug EngSys
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Azure/azure-sdk-for-cpp#7362 ·
Los mantenedores suelen responder en 1 día
-
Client needs-team-attention Service Attention Storage
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Azure/azure-sdk-for-cpp#7347 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Client Event Hubs needs-team-attention Service Attention
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Azure/azure-sdk-for-cpp#7333 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Azure Storage STG105 Feature TestsQuizá libre de nuevo @Jinming-Hu la tomó hace 28 días y no hay ningún pull request abierto. AbiertoClient Storage
Azure/azure-sdk-for-cpp#7449 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Azure.Core bug test-enhancement
Dificultad 3/5 1-2 días Aptitud para principiantes 66/100
Azure/azure-sdk-for-cpp#7401 ·
Los mantenedores suelen responder en 1 día
Todos los issues de Azure/azure-sdk-for-cpp
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
colbymchenry/codegraph#3223 ·
Los mantenedores suelen responder en 1 día
-
The `ufw` decoder requires the kernel's monotonic timestamp, so UFW lines read from journald decode without any fieldPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
arduino/ArduinoCore-megaavr#152 ·
-
bug needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
microsoft/microsoft-ui-xaml#12515 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
BlueQuartzSoftware/simplnx#1906 ·
Los mantenedores suelen responder en 4 días