Skip to content

Commit

Permalink
Fix TaskInfo serialization and unmute task_list bwc test (#2766)
Browse files Browse the repository at this point in the history
Fixes the version check around resourceStats serialization and unmutes the
failing bwc test.

Signed-off-by: Nicholas Walter Knize <[email protected]>
  • Loading branch information
nknize authored Apr 5, 2022
1 parent 21f9950 commit 406ee36
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
"tasks_list test":
- skip:
version: "all"
reason: "AwaitsFix https://github.com/opensearch-project/OpenSearch/issues/2757"
features: [arbitrary_key]

- do:
Expand Down
4 changes: 2 additions & 2 deletions server/src/main/java/org/opensearch/tasks/TaskInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public TaskInfo(StreamInput in) throws IOException {
}
parentTaskId = TaskId.readFromStream(in);
headers = in.readMap(StreamInput::readString, StreamInput::readString);
if (in.getVersion().onOrAfter(Version.V_2_0_0)) {
if (in.getVersion().onOrAfter(Version.V_2_1_0)) {
resourceStats = in.readOptionalWriteable(TaskResourceStats::new);
} else {
resourceStats = null;
Expand All @@ -164,7 +164,7 @@ public void writeTo(StreamOutput out) throws IOException {
}
parentTaskId.writeTo(out);
out.writeMap(headers, StreamOutput::writeString, StreamOutput::writeString);
if (out.getVersion().onOrAfter(Version.V_2_0_0)) {
if (out.getVersion().onOrAfter(Version.V_2_1_0)) {
out.writeOptionalWriteable(resourceStats);
}
}
Expand Down

0 comments on commit 406ee36

Please sign in to comment.