Request each service's tasks separately #1489
Closed
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.
Signed-off-by: Drew Erny drew.erny@docker.com
- What I did
When doing a
docker service ls
, get each service's tasks in separate requests, instead of all in one request.- How I did it
There is currently a bug in swarmkit and the docker engine (moby/moby#37997) where large numbers of tasks can cause the message size to exceed the gRPC limits. A more appropriate fix involves changing the swarmkit gRPC api internally in some way or another to avoid this case occurring, but that fix requires more engineering effort and will take longer.
As a short-term band-aid, when using the CLI, split task list requests by service, which will cause the message size to not grow beyond the gRPC limits.
This fix leaks a bit of the abstraction presented by the engine API, but the resulting code is functionally equivalent. The alternative band-aid fix, contained solely to the engine, would involve attempting to deconstruct filters in the engine to make multiple requests, instead of merely converting. It is therefore cleaner to make this change here, where the request ultimately originates.
This change can and will be reverted when the engine fix goes in.
- How to verify it
As the code is functionally equivalent, the extant tests should cover it.
- Description for the changelog
Use a different request to get every service's tasks when doing a service ls to avoid a current engine bug.