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

auth: get rid of deadlocking channel passing scheme in simpleTokenTTL #7492

Merged
merged 2 commits into from
Mar 14, 2017

Conversation

heyitsanthony
Copy link
Contributor

Just use the mutex instead.

Fixes #7471

@xiang90
Copy link
Contributor

xiang90 commented Mar 13, 2017

LGTM. Is it easy to get a test covering the bad case?

/cc @davissp14 do you mind giving this a quick test?

@davissp14
Copy link
Contributor

@xiang90 Sadly I am out tonight, but will be able to test tomorrow morning.

@xiang90
Copy link
Contributor

xiang90 commented Mar 13, 2017

lgtm

@mitake
Copy link
Contributor

mitake commented Mar 14, 2017

@heyitsanthony thanks a lot for the fix! The changes look good to me. But I could reproduce the test failure on my local env, too:

--- FAIL: TestCtlV3UserDelete (1.19s)
	ctl_v3_user_test.go:93: userDelTest #1: ctlV3User error (read /dev/ptmx: input/output error)
	ctl_v3_test.go:150: error closing etcd processes (exit status 2)
=== RUN   TestCtlV3UserPasswd
--- FAIL: TestCtlV3UserPasswd (0.69s)
	ctl_v3_user_test.go:116: userPasswdTest #1: ctlV3User error (read /dev/ptmx: input/output error)
	ctl_v3_test.go:150: error closing etcd processes (exit status 2)

I'll take a look at the test cases.

@davissp14
Copy link
Contributor

Tested out the changes and wasn't able to reproduce the deadlock. Nice work!

@heyitsanthony
Copy link
Contributor Author

@mitake the crash was caused by calling UserDelete when auth is disabled; the ttl keeper was nil so trying to acquire the lock in invalidateUser would crash it.

@mitake
Copy link
Contributor

mitake commented Mar 14, 2017

@heyitsanthony I see. lgtm after CIs can be passed, thanks!

@codecov-io
Copy link

Codecov Report

Merging #7492 into master will decrease coverage by 0.08%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #7492      +/-   ##
==========================================
- Coverage   70.73%   70.65%   -0.09%     
==========================================
  Files         245      245              
  Lines       21486    21487       +1     
==========================================
- Hits        15198    15181      -17     
- Misses       5156     5176      +20     
+ Partials     1132     1130       -2
Impacted Files Coverage Δ
auth/simple_token.go 94.73% <100%> (+8.01%)
pkg/adt/interval_tree.go 78.71% <0%> (-6.09%)
lease/leasehttp/http.go 59.54% <0%> (-3.06%)
pkg/netutil/netutil.go 77.94% <0%> (-2.95%)
rafthttp/msgappv2_codec.go 69.56% <0%> (-1.74%)
etcdserver/server.go 78.45% <0%> (-1.29%)
etcdserver/v3_server.go 61.84% <0%> (-1.1%)
raft/node.go 89.73% <0%> (-0.45%)
rafthttp/transport.go 81.92% <0%> (ø)
rafthttp/stream.go 89.7% <0%> (+0.66%)
... and 6 more

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 3a61fe5...4409932. Read the comment docs.

@mitake mitake merged commit 148c923 into etcd-io:master Mar 14, 2017
@davissp14
Copy link
Contributor

Will this be added to 3.1.4?

@heyitsanthony
Copy link
Contributor Author

@davissp14 yes, it's tagged for backporting

@heyitsanthony heyitsanthony deleted the simpletokenttl-deadlock branch March 15, 2017 19:28
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.

6 participants