Fix NPE in batchPoll by returning 200 OK + empty list instead of 204 #608
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request type
Changes in this PR
Fix NPE in batchPoll by returning empty list instead of 204
Problem
The
batchPollendpoint returned204 No Contentwhen no tasks were available, causing NPE in client libraries that expected a list object.Solution
Changed
TaskResource.batchPoll()to always return200 OKwith an empty list instead of204 No Content.So clients always get 200 OK with either:
Impact
HttpEndToEndTest.testAllNPE (issue HTTP status code mismatch between server and clients since PR #69 (broken tests) #602, failure Issue/upgrade to spring (#3828) #1)List<Task>typeChanges
rest/src/main/java/com/netflix/conductor/rest/controllers/TaskResource.java:73-84SDK Compatibility Analysis for batchPoll Fix (generated by Claude Code):
Java SDK (java-sdk/conductor-client/src/main/java/com/netflix/conductor/client/http/TaskClient.java:546-561):
Go SDK (go-sdk/sdk/client/api_task_resource.go:92-93):
C# SDK (csharp-sdk/Conductor/Api/TaskResourceApi.cs:263-267):
Python SDK:
All four SDKs expect a list/array type from the batchPoll endpoint: