Skip to content

ExecutePolicyResponse: null taskId when running executePolicy with wait_for_completion=false #968

@chisogch

Description

@chisogch

Java API client version

8.15.5

Java version

1.8.0_381

Elasticsearch Version

8.15.5

Problem description

The ExecutePolicyResponse returned by executePolicy has a null taskId when using ?wait_for_completion=false (see issues 376 and 744).
The client correctly receives the taskid from the server ("task" property) in performRequest() but fails to deserialize it in decodeTransportResponse. The property is seen as an "unknown" property.

The cause could be located in ExecutePolicyResponse : the JsonpDeserializer uses "task_id" and not "task".

public static final JsonpDeserializer<ExecutePolicyResponse> _DESERIALIZER = ObjectBuilderDeserializer
		.lazy(Builder::new, ExecutePolicyResponse::setupExecutePolicyResponseDeserializer);

protected static void setupExecutePolicyResponseDeserializer(ObjectDeserializer<ExecutePolicyResponse.Builder> op) {

	op.add(Builder::status, ExecuteEnrichPolicyStatus._DESERIALIZER, "status");
	op.add(Builder::taskId, JsonpDeserializer.stringDeserializer(), "task_id");

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: SpecificationRelated to the API spec used to generate client codeCategory: BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions