Repository navigation
fix: select only executor jobs for a single task - #183
Conversation
listSingleTaskExecutorJobs selected a task's jobs by the label
taskmaster-name alone. Taskmasters with tesk-core#147 also give the
filers' jobs that label, so that the inputs filer stood in as the
outputs filer: GET /tasks/{id} reported COMPLETE instead of
SYSTEM_ERROR after an ignored executor failure whose taskmaster stopped
before the outputs filer. Select job-type=executor as well.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
TESK API with the executor-only selector must be deployed before a taskmaster that labels the filers' jobs with taskmaster-name. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The ignore_error note said to upgrade the taskmaster first, which contradicts the order needed for filer labels if one tesk-core release brings both. Describe how a single task's jobs are matched in "Getting tasks", and say in SingleTaskJobsIT that its stubs are keyed per selector. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideImplementationRestrict single-task executor job listing to jobs carrying both the taskmaster and executor labels, preventing filer jobs from being treated as executors.
DocumentationDocument how single-task executor and outputs-filer jobs are identified, and the safe rollout order for taskmasters that label filer jobs.
TestsAdd integration coverage showing filer-label collisions no longer corrupt task state, using job-list responses keyed to the respective selectors.
Other changesFiles not grouped.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #183 +/- ##
==========================================
+ Coverage 77.60% 77.61% +0.01%
==========================================
Files 74 74
Lines 3487 3489 +2
Branches 416 416
==========================================
+ Hits 2706 2708 +2
Misses 621 621
Partials 160 160 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Linked issuesChecked at commit 2d3cb02 #182 fix: select only executor jobs for a single task · 3 of 3 met
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="docs/upgrading.md" line_range="90" />
<code_context>
+ (before: `taskmaster-name` only). Taskmasters of tesk-core releases with
+ [tesk-core#147](https://github.com/elixir-cloud-aai/tesk-core/issues/147)
+ also give the filers' jobs the label `taskmaster-name`. Upgrade TESK API
+ to this release before, or together with, setting the taskmaster to such
+ a release (`TESK_API_TASKMASTER_IMAGE_VERSION`, see
+ [Configuration](configuration.md)); never set it on an older TESK API.
</code_context>
<issue_to_address>
**Task state and cancellation are wrong**
When the API and taskmaster are upgraded together while old API replicas still handle requests, `readTask` selects the labelled inputs filer, and `TaskBuilder` treats that untyped job as the outputs filer, so task reads report the wrong state and cancellation can be rejected while the taskmaster is running.
Require the API rollout to finish before enabling a taskmaster release that adds the filer labels.
Also at `docs/upgrading.md:91`.
</issue_to_address>Sourcery assessment
Approval pending. 1 finding to address first.
Blocking findings: docs/upgrading.md:90
During a rolling update, older TESK API replicas still serve requests and misreport tasks of a taskmaster that labels the filers' jobs. Set that taskmaster only once no older replica runs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Brings in #161, #174, #175, #176, #178, #181, #183 and #184. The conflict in docs/upgrading.md is resolved by merging both lists under "To 1.3.0": the upgrade order for filer labels and Java 21 come first, and the TES 1.1 fields item no longer says that ignore_error: true is refused. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Lists the changes merged into dev since the notes were written: Java 21 (#161), ignore_error (#174), the resource server (#175), output file logs (#176), the Kubernetes client (#178), Dependabot labels (#181), the executor job selector (#183) and full test coverage (#184). Adds a Breaking changes section, as in the 1.2.0 notes, and sets date-released to the planned tag date, 2026-11-16. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Summary
listSingleTaskExecutorJobs(used byGET /tasks/{id}andPOST /tasks/{id}:cancel) now selectstaskmaster-name=<id>,job-type=executorinstead oftaskmaster-name=<id>only. Taskmasters with elixir-cloud-aai/tesk-core#147 also give the filer jobs the labeltaskmaster-name;TaskBuilderroutes every listed job withoutjob-typeto the outputs filer slot, so the inputs filer stood in as the outputs filer. After an ignored executor failure whose wait timed out,GET /tasks/{id}then reportedCOMPLETEinstead ofSYSTEM_ERROR.Executor jobs have always carried
job-type=executor(TESK API builds their template), so the selector works with old and new taskmasters alike and can be deployed before the tesk-core release that labels filer jobs.KubernetesClientWrapper.listSingleTaskExecutorJobs.SingleTaskJobsIT(WireMock stubs per label selector, with a filer job labelled as by tesk-core#147): the timed-outignore_errorcase isSYSTEM_ERROR, and a failed inputs filer isn't taken for a failed outputs filer. Both failed before the fix (COMPLETEandSYSTEM_ERROR). UpdatedKubernetesClientWrapperTestand the WireMock URL inMockUtil.docs/upgrading.mdgets the upgrade order (this TESK API before or together with a taskmaster that labels filer jobs), and theignore_errornote no longer says "taskmaster first", which would contradict it if one tesk-core release brings both.docs/index.md("Getting tasks") says how a single task's executors and outputs filer are matched.Closes #182
Verification
./mvnw -B clean verify(Java 21): BUILD SUCCESS, all unit and integration tests pass, JaCoCo check passes. Before the fix:KubernetesClientWrapperTest.listSingleTaskExecutorJobsand bothSingleTaskJobsITtests failed../mvnw -B spotless:check checkstyle:check(Java 8): BUILD SUCCESS, 0 violations.mkdocs build --strict: passes.Declined review findings
POST /tasks/{id}:cancel. Cancel reads the task through the samereadTaskasGET /tasks/{id}, which the new ITs cover; the adversarial reviewer confirmed the shared path.SingleTaskJobsITrepeats the Spring/WireMock setup of the other ITs. That is the existing convention;MockUtilhas no general job builder to reuse (itsjobListis reused).Open questions
None.
🤖 Generated with Claude Code
Summary by Sourcery
Select only executor jobs when reading or cancelling a single task to prevent filer jobs from producing incorrect task states.
Bug Fixes:
Documentation:
Tests: