Add @Nullable to TaskStatus::containerStatus #1005
Description
I very often receive an exception at the very beginning of the Swarm Task launch:
Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `com.spotify.docker.client.messages.swarm.TaskStatus`, problem: Null containerStatus
at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 1, column: 8864] (through reference chain: java.util.ArrayList[5]->com.spotify.docker.client.messages.swarm.Task["Status"])
at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:67)
... common frames omitted
Caused by: java.lang.NullPointerException: Null containerStatus
at com.spotify.docker.client.messages.swarm.AutoValue_TaskStatus.(AutoValue_TaskStatus.java:38)
at com.spotify.docker.client.messages.swarm.TaskStatus.create(TaskStatus.java:75)
... common frames omitted
I think that when Swarm Task just started "ContainerStatus" is not present.
When the task started after a while, the exception disappears.
How to reproduce
Often poll task status:
GET unix://localhost:80/tasks?filters=%7B%22desired-state%22%3A%5B%22running%22%5D%7D
Software:
-
docker version
:
Client:
Version: 18.03.0-ce
API version: 1.37
Go version: go1.9.4
Git commit: 0520e24
Built: Wed Mar 21 23:09:15 2018
OS/Arch: linux/amd64
Experimental: false
Orchestrator: swarm
Server:
Engine:
Version: 18.03.0-ce
API version: 1.37 (minimum version 1.12)
Go version: go1.9.4
Git commit: 0520e24
Built: Wed Mar 21 23:13:03 2018
OS/Arch: linux/amd64
Experimental: false -
Spotify's docker-client version: 8.11.1