Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request each service's tasks separately #1489

Closed
wants to merge 1 commit into from

Conversation

dperny
Copy link
Contributor

@dperny dperny commented Oct 29, 2018

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.

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 would
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.

Signed-off-by: Drew Erny <drew.erny@docker.com>
@dperny
Copy link
Contributor Author

dperny commented Oct 29, 2018

cc @anshulpundir

@codecov-io
Copy link

Codecov Report

Merging #1489 into master will decrease coverage by 0.91%.
The diff coverage is 71.42%.

@@            Coverage Diff             @@
##           master    #1489      +/-   ##
==========================================
- Coverage   55.14%   54.23%   -0.92%     
==========================================
  Files         289      289              
  Lines       19371    19361      -10     
==========================================
- Hits        10683    10500     -183     
- Misses       7997     8185     +188     
+ Partials      691      676      -15

@andrewhsu
Copy link
Contributor

Just ran a test with this change and it definitely slows stuff down.

With 17.06, on a system with about 70 services and about 20 tasks per service, takes about 16 seconds. With this PR, takes about 38 seconds.

Thinking of alternatives...

@andrewhsu
Copy link
Contributor

andrewhsu commented Oct 30, 2018

something's coming in the air tonight...hold on

@andrewhsu
Copy link
Contributor

@dperny i elect to close this PR in favor of the work in moby to address the same issue: moby/moby#38103

@thaJeztah
Copy link
Member

Agreed, I don't think think this is the solution we're looking for 🤗

@thaJeztah thaJeztah closed this Oct 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants