From 51b441df6fa7e338af2a2d12acecbf640e3dd202 Mon Sep 17 00:00:00 2001 From: Andreas Schwarte Date: Mon, 30 Mar 2026 18:58:46 +0200 Subject: [PATCH 1/2] GH-5732: fix application specific thread context in federated service RepositoryFederatedService uses a background thread for processing and may miss application specific thread context. This change adds a callback protected method that allows to wrap the runnable, prior to passing it to the executor --- .../federation/RepositoryFederatedService.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/federation/RepositoryFederatedService.java b/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/federation/RepositoryFederatedService.java index ac01aaa3fd5..2875bbd6129 100644 --- a/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/federation/RepositoryFederatedService.java +++ b/core/repository/sparql/src/main/java/org/eclipse/rdf4j/repository/sparql/federation/RepositoryFederatedService.java @@ -86,7 +86,7 @@ public BatchingServiceIteration(CloseableIteration inputBindings, // See: https://github.com/eclipse-rdf4j/rdf4j/discussions/5120 // Test case: https://github.com/tkuhn/rdf4j-timeout-test try { - querySubmissionTask = threadExecutor.submit(this::run); + querySubmissionTask = threadExecutor.submit(wrap(this::run)); } catch (Exception e) { throw new QueryEvaluationException("Failed to start a thread for batched federated query submission", e); @@ -661,4 +661,15 @@ private static void closeQuietly(RepositoryConnection conn) { logger.debug("Details: ", t); } } + + /** + * Callback to wrap the runnable prior to passing it to the background Executor. Can be used by specializations to + * apply context. + * + * @param runnable the runnable + * @return the runnable + */ + protected Runnable wrap(Runnable runnable) { + return runnable; + } } From a32c67ab75c2f55ca62648424845d1889090e060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20M=2E=20Ottestad?= Date: Thu, 9 Apr 2026 17:25:14 +0200 Subject: [PATCH 2/2] Fix formatting and numbering in AGENTS.md (#5738) --- AGENTS.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 46a99319a4b..6d98efc76de 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -101,19 +101,19 @@ Always keep untracked artifacts! → **Yes:** **Routine D (ExecPlans)**. Use an ExecPlan (as described in .agent/PLANS.md) from design to implementation. → **No:** continue. -3**Does a failing test already exist in this repo that pinpoints the issue?** +3. **Does a failing test already exist in this repo that pinpoints the issue?** → **Yes:** **Routine B (Bugfix using existing failing test).** → **No:** continue. -4**Is the edit strictly behavior‑neutral, local in scope, and clearly hit by existing tests?** +4. **Is the edit strictly behavior‑neutral, local in scope, and clearly hit by existing tests?** → **Yes:** **Routine B (Refactor/micro‑perf/documentation/build).** → **No or unsure:** continue. -4. **Is new externally observable behavior required?** +5. **Is new externally observable behavior required?** → **Yes:** **Routine A (Full TDD)**. Add the smallest failing test first. → **No:** continue. -5. **Is this purely an investigation/design spike with no production code changes?** +6. **Is this purely an investigation/design spike with no production code changes?** → **Yes:** **Routine C (Spike/Investigate).** → **No or unsure:** **Routine A.**