Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Document the thread safety contract on every public Event Hubs type

Abierto
#7,289 0 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@j7nw4r ya está trabajando en esto.

Desde el 5/8/2026.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

Event Hubs

Summary

No public Event Hubs header gives a thread safety guarantee. The C++ guidelines make thread safety mandatory for a service client. The .NET library gives the guarantee in its README and in its reference documents. A C++ caller has no way to learn which types are safe to share.

Parent: #7284. Severity tags follow the key in #7252. The code anchors refer to commit 2de7c583e.

Motivation

A search of sdk/eventhubs for "thread safe", "thread-safe" and "thread safety" finds one file. That file is a third-party header in the stress test (test/eventhubs-stress-test/src/inc/argagg.hpp:612). No client header, no model header and no README says anything.

The .NET README gives the guarantee in two sentences. The C++ library can use the same words. The first sentence says that all client instance methods are thread safe and independent of each other. The second says that each Event Hubs client type is safe to cache and to use as a singleton for the life of the application. The processor README repeats this for EventProcessorClient.

The .NET and Python documents both say that their batch type is not thread safe. The C++ library needs the same restriction on EventDataBatch.

The C++ guidelines demand the behavior. They say nothing about how to document it. The document design below follows .NET practice, not a C++ rule. Tell the GA API review which part is mandatory and which part is practice.

Proposal

Give the guarantee on each client type.

  • ProducerClient (inc/azure/messaging/eventhubs/producer_client.hpp). [GA quality bar]
  • ConsumerClient (inc/azure/messaging/eventhubs/consumer_client.hpp). [GA quality bar]
  • PartitionClient (inc/azure/messaging/eventhubs/partition_client.hpp). [GA quality bar]
  • Processor and ProcessorPartitionClient (inc/azure/messaging/eventhubs/processor.hpp, inc/azure/messaging/eventhubs/processor_partition_client.hpp). [GA quality bar]
  • CheckpointStore, on the abstract base class (inc/azure/messaging/eventhubs/checkpoint_store.hpp). A third-party implementor must learn that the implementation must be thread safe. The processor calls it from its own partition threads. [GA quality bar]

Give the restriction on each model type.

  • EventDataBatch (inc/azure/messaging/eventhubs/event_data_batch.hpp). [GA quality bar]
  • Models::EventData, and the checkpoint and ownership record structures (inc/azure/messaging/eventhubs/models/). [GA quality bar]

Then update the package documents.

  • Add a thread safety section to the package README. Use the .NET words about caching a client for the life of the application. [GA quality bar]
  • Record the guarantee and the batch restriction in the changelog for the release that contains them. [GA quality bar]

The words must agree with the code. Do this change after the behavior is correct, or do it in the same change.

Validation

  • Each public client type gives its thread safety guarantee in its class documentation.
  • Each model type that is not thread safe gives that restriction.
  • The README has a thread safety section.
  • A reviewer who reads only the headers can identify which types are safe to share across threads.
Lenguaje dominante
C++
Estrellas
206
Forks
173
Merge medio
2 d 4 h
PR fusionados (30 d)
27

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Azure/azure-sdk-for-cpp

Todos los issues de Azure/azure-sdk-for-cpp

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.