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.** 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; + } }