Make RestCatalog safe to share across threads

Abierto
#1,091 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

@smaheshwar-pltr ya está trabajando en esto.

Desde el 4/11/2026.

  • #1092 de @smaheshwar-pltr — abierto

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
cpp
Área
backend

Línea de trabajo

Read src/iceberg/catalog/rest/rest_catalog.cc around AsCatalog() at lines 565–573, then inspect the HttpClient path and the linked issue #1089 to understand the shared request state. Make the default catalog cache safe for concurrent access and confirm the linked HTTP client work supports sharing; done means concurrent catalog use has no data race. An open pull request, #1092, is already linked.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Currently, RestCatalog doesn't document whether one instance can be shared between threads. Query engines usually share one catalog across concurrent queries (for example Spark within a session, Trino, and DuckDB), and iceberg-rust requires catalogs to be Send + Sync (code).

Without that guarantee, an embedder has to serialize every catalog call behind its own lock. That costs throughput, and one hung request then blocks every other caller. In https://github.com/smaheshwar-pltr/duckdb-proto-iceberg, we observed that making a catalog-heavy test about 4x slower.

RestCatalog is close to thread-safe already. After Make(), the only state it changes is the default catalog that AsCatalog() caches in a weak_ptr. It reads and writes that cache without a lock, so concurrent AsCatalog() calls race (rest_catalog.cc#L565-L573).

Note: sharing a catalog also depends on https://github.com/apache/iceberg-cpp/issues/1089, because every request goes through one HttpClient.

Lenguaje dominante
C++
Estrellas
227
Forks
142
Merge medio
3 d 21 min
PR fusionados (30 d)
70

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

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 apache/iceberg-cpp

Todos los issues de apache/iceberg-cpp

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.