-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Don't forward _ping requests to the primary #2554
Conversation
c064c2b
to
71c709d
Compare
In #2492, we noticed that the |
Requests should be independent of each other. If this is the case we have a bug. Can you provide the reproduce sequence for this? |
There's more discussion in #2526. We never fully figured out a solid repro for this issue, but both me and @michelvocks saw this issue. |
@dongluochen @wsong You are right. This is a bug. I spent more time on investigating the issue and the root of it is this commit: docker/engine-api@5dd6452 The client is reusing the same connection. That means it first sends the cp := func(dst io.Writer, src io.Reader, chDone chan struct{}) {
io.Copy(dst, src)
if conn, ok := dst.(interface {
CloseWrite() error
}); ok {
conn.CloseWrite()
}
close(chDone)
}
inDone := make(chan struct{})
outDone := make(chan struct{})
go cp(d, nc, inDone)
go cp(nc, d, outDone) The go-routine reads the whole stream and then forwards it to the primary docker swarm manager and because we are using the same connection for the |
71c709d
to
ff26600
Compare
Rebased on top of #2492 |
Signed-off-by: Wayne Song <[email protected]>
ff26600
to
e15bc28
Compare
@wsong was there further discussion about this PR? Have you faced the issue lately? |
This isn't so much an issue as it is a feature request; because Swarm replicas can occasionally lose their connection to the primary, we want to be able to hit an endpoint telling us whether or not there is currently an elected primary, from the perspective of this replica. This is useful when, for instance, you add a new Swarm manager and it takes a while to connect to the KV store; we can hit |
This is no longer relevant now that we block in |
No description provided.