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

*: handle request timeout error to '/member' when bootstrapping #7873

Closed
wants to merge 1 commit into from

Conversation

gyuho
Copy link
Contributor

@gyuho gyuho commented May 4, 2017

Fix #7267.

In slow CPU machine, it often takes more than 10ms, so times out.

When log is enabled, I get a bunch of

2017-05-04 01:28:59.260298 W | etcdserver: could not get cluster response from unix://127.0.0.1:2100723422: Get unix://127.0.0.1:2100723422/members: net/http: request canceled (Client.Timeout exceeded while awaiting headers)
2017-05-04 01:28:59.260471 W | etcdserver: could not get cluster response from unix://127.0.0.1:2100723422: Get unix://127.0.0.1:2100723422/members: net/http: request canceled (Client.Timeout exceeded while awaiting headers)

@gyuho gyuho added the WIP label May 4, 2017
@gyuho gyuho changed the title integration: increase BootstrapTimeout [DO NOT MERGE] integration: increase BootstrapTimeout May 4, 2017
Fix etcd-io#7267.

In slow CPU machine, it often takes more than 10ms, so times out.

Signed-off-by: Gyu-Ho Lee <[email protected]>
@heyitsanthony
Copy link
Contributor

I set my bootstrap timeout to a nanosecond and was able to reproduce #7267.

If the test is failing because c.Launch(t) is failing to bootstrap, shouldn't c.Launch(t) be fataling out before the test reaches m.Launch(t)? Bad error handling somewhere?

@codecov-io
Copy link

codecov-io commented May 4, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@4301f49). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #7873   +/-   ##
=========================================
  Coverage          ?   76.02%           
=========================================
  Files             ?      332           
  Lines             ?    26203           
  Branches          ?        0           
=========================================
  Hits              ?    19921           
  Misses            ?     4863           
  Partials          ?     1419

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4301f49...c73abaa. Read the comment docs.

@gyuho
Copy link
Contributor Author

gyuho commented May 4, 2017

@heyitsanthony

It's failing here with m.Launch(t) (member that's supposed to fail when launching)

https://github.com/coreos/etcd/blob/master/etcdserver/server.go#L342

if isMemberBootstrapped(cl, cfg.Name, prt, cfg.bootstrapTimeout()) {
	return nil, fmt.Errorf("member %s has already been bootstrapped", m.ID)
}

Normal fresh cluster expects isMemberBootstrapped to return false because it has not been bootstrapped yet. It returns false with Client.Timeout exceeded while awaiting headers errors.

Duplicate config member, however, expects isMemberBootstrapped to return true. The duplicate member should be found via /member endpoint. But also possible to return false, when request to /member times out, with Client.Timeout exceeded while awaiting headers errors.

So it's failing in m.Launch(t) (cloned member duplicate launch), because request timed out (10ms) and isMemberBootstrapped returned false.

We need to differentiate between time-out from slow network and time-out from non-existing /member endpoint?

@heyitsanthony
Copy link
Contributor

OK, isMemberBootStrapped should probably return the error (instead of just false) so etcd doesn't try to boot?

@gyuho gyuho changed the title [DO NOT MERGE] integration: increase BootstrapTimeout *: handle request timeout error to '/member' when bootstrapping May 4, 2017
@gyuho gyuho force-pushed the master branch 2 times, most recently from 44ca396 to 4301f49 Compare June 2, 2017 15:53
@gyuho gyuho closed this Mar 3, 2018
@gyuho gyuho deleted the launch-fail branch March 3, 2018 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants