fix(executor): avoid retaining a callback when lazy worker startup fails
Les mainteneurs répondent en général sous 1 jour
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 15/100
Piste de recherche
The fault is in DefaultExecutor::Add in executor.cpp, which enqueues the callback before lazy worker startup. Read that function and the lazy-startup path under the mutex, and note that status.cpp is compiled alongside it in the reproduction. Done means a failed startup leaves no retained callback, and a regression test injects allocation failures and shows later submissions do not run the failed callback. PR #437 already targets this, so review or coordinate there first.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Problem
DefaultExecutor::Add queues its callback before reserving/starting lazy worker threads. If worker-vector allocation or thread startup throws, Add reports failure but retains that invocation's callback. A later successful submission can execute it. Callers therefore cannot assume that an escaping submission error means their callback was not accepted.
Actual-source reproduction
Base: 242decffdfdefef01dcd0e52e48c9a1e69792479 (main).
Linux x86_64, GCC 15.3, C++17. A standalone executable compiles the unmodified executor.cpp and status.cpp, with submitting-thread-only scalar-new injection. Executor, callables, promises, and futures are prepared before injection. Faults are disarmed before recovery and shutdown.
For a one-worker executor, observe allocations during the actual first Add, then inject each observed ordinal on a fresh executor. Catch bad_alloc, submit a recovery marker, wait for it on that same single-worker FIFO, and join the executor:
ordinal=1 fired=1 caught=1 observed=1 recovered=1 failed_callback_runs=1
ordinal=2 fired=1 caught=1 observed=2 recovered=1 failed_callback_runs=1
allocations=2 retained=2
The program exits 1 for callback retention, not a crash or timeout. This is executor CPU evidence, not a full native planner reproduction or GPU execution.
Proposed narrow fix and acceptance
- Complete lazy worker startup under the existing mutex before enqueueing the current callback.
- Preserve empty/stopped behavior and existing successful scheduling.
- Test real production-object allocation failures, active injection, successful recovery, partial startup, queue growth, and normal subsequent cleanup.
- Keep callable ownership/capture lifetimes alive through cleanup in the regression itself.
- Partial worker startup may leave idle workers; this fix need not restore configured capacity, but must not retain the failed invocation and must permit normal recovery/join.
This is a prerequisite ownership contract related to #435. It does not implement or close that feature: query cancellation, task draining, planning budgets, custom executor contracts, and allocation-failure safety of ShutdownNow remain separate.
- Langage dominant
- C++
- Étoiles
- 68
- Forks
- 34
- Merge moyen
- 3 j 18 h
- PR mergées (30 j)
- 44
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de apache/paimon-cpp
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 8/100
apache/paimon-cpp#435 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
[Feature] Prune manifest partitions before metadata decodingPeut-être pris @gripleaf l’a pris il y a 5 jours. Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 25/100
apache/paimon-cpp#433 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
apache/paimon-cpp#410 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
apache/paimon-cpp#409 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
apache/paimon-cpp#408 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de apache/paimon-cpp
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
CachyOS/New-Cli-Installer#50 ·
-
Difficulté 1/5 1-3 heures Accessibilité débutants 90/100
Qiskit/qiskit-aer#2482 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
nasa/fprime#6225 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
content good first issue
Difficulté 1/5 Moins d'une heure Accessibilité débutants 95/100
cpinitiative/usaco-guide#6699 ·
Les mainteneurs répondent en général sous 1 jour
-
git: need better push commandOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
codepointerapp/codepointer#231 ·