Skip to content

Fix v1 fallback to handle HTTP 405 from update-task-v2 on older Conductor#388

Merged
v1r3n merged 1 commit intomainfrom
fix/backward-compat-handle-405-fallback
Mar 19, 2026
Merged

Fix v1 fallback to handle HTTP 405 from update-task-v2 on older Conductor#388
v1r3n merged 1 commit intomainfrom
fix/backward-compat-handle-405-fallback

Conversation

@manan164
Copy link
Contributor

Problem

On Conductor instances older than v5, the SDK's fallback from update-task-v2 to the v1 update endpoint was not triggering.

The previous fix (#387) only checked for HTTP 404. However, Conductor 4.x returns 405 (Method Not Allowed) instead of 404 when the SDK POSTs to /tasks/update-v2. This happens because the wildcard GET /{taskId} route in Conductor's TaskResource matches the path — Spring MVC sees a known path with the wrong method and returns 405 rather than 404.

As a result, task updates failed after exhausting all 4 retries with no fallback, breaking workers entirely on Conductor 4.x.

Changes

  • Handle e.status in (404, 405) in both TaskRunner and AsyncTaskRunner
  • Include the actual HTTP status code in the warning log message
  • Add unit test covering the 405 fallback case

Validation

Tested against a locally built Conductor 4.1.66 instance. Confirmed the following log sequence when the SDK connects to Conductor 4.x:

WARNING  task_runner: Server does not support update-task-v2 endpoint (HTTP 405). Falling back to v1 update endpoint.
DEBUG    task_runner: Updated task (v1), id: ...

All subsequent task updates go directly to v1 with no further retries.

On Conductor instances older than v5, POSTing to /tasks/update-v2 returns
405 (Method Not Allowed) rather than 404 (Not Found). This happens because
the wildcard GET handler @GetMapping("/{taskId}") matches the path, causing
Spring MVC to reject the POST with 405 instead of a plain 404.

The previous fix only checked for status 404, so the fallback to the v1
update endpoint never triggered on Conductor 4.x, leaving task updates
failing after 4 retries.

Changes:
- Check e.status in (404, 405) in both TaskRunner and AsyncTaskRunner
- Log the actual HTTP status code in the warning message
- Add unit test covering the 405 fallback case
@v1r3n v1r3n merged commit eba99a1 into main Mar 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants