Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
a8dbab66
Commit
a8dbab66
authored
Sep 23, 2016
by
Timothy St. Clair
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update etcd godep to 3.0.10 to fix known watch issue.
parent
69083bcf
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
20 deletions
+29
-20
Godeps.json
Godeps/Godeps.json
+0
-0
watch.go
vendor/github.com/coreos/etcd/clientv3/watch.go
+27
-19
stream.go
vendor/github.com/coreos/etcd/rafthttp/stream.go
+1
-0
version.go
vendor/github.com/coreos/etcd/version/version.go
+1
-1
No files found.
Godeps/Godeps.json
View file @
a8dbab66
This diff is collapsed.
Click to expand it.
vendor/github.com/coreos/etcd/clientv3/watch.go
View file @
a8dbab66
...
@@ -127,6 +127,8 @@ type watchGrpcStream struct {
...
@@ -127,6 +127,8 @@ type watchGrpcStream struct {
donec
chan
struct
{}
donec
chan
struct
{}
// errc transmits errors from grpc Recv to the watch stream reconn logic
// errc transmits errors from grpc Recv to the watch stream reconn logic
errc
chan
error
errc
chan
error
// closingc gets the watcherStream of closing watchers
closingc
chan
*
watcherStream
// the error that closed the watch stream
// the error that closed the watch stream
closeErr
error
closeErr
error
...
@@ -189,11 +191,12 @@ func (w *watcher) newWatcherGrpcStream(inctx context.Context) *watchGrpcStream {
...
@@ -189,11 +191,12 @@ func (w *watcher) newWatcherGrpcStream(inctx context.Context) *watchGrpcStream {
cancel
:
cancel
,
cancel
:
cancel
,
streams
:
make
(
map
[
int64
]
*
watcherStream
),
streams
:
make
(
map
[
int64
]
*
watcherStream
),
respc
:
make
(
chan
*
pb
.
WatchResponse
),
respc
:
make
(
chan
*
pb
.
WatchResponse
),
reqc
:
make
(
chan
*
watchRequest
),
reqc
:
make
(
chan
*
watchRequest
),
stopc
:
make
(
chan
struct
{}),
stopc
:
make
(
chan
struct
{}),
donec
:
make
(
chan
struct
{}),
donec
:
make
(
chan
struct
{}),
errc
:
make
(
chan
error
,
1
),
errc
:
make
(
chan
error
,
1
),
closingc
:
make
(
chan
*
watcherStream
),
}
}
go
wgs
.
run
()
go
wgs
.
run
()
return
wgs
return
wgs
...
@@ -242,7 +245,6 @@ func (w *watcher) Watch(ctx context.Context, key string, opts ...OpOption) Watch
...
@@ -242,7 +245,6 @@ func (w *watcher) Watch(ctx context.Context, key string, opts ...OpOption) Watch
case
reqc
<-
wr
:
case
reqc
<-
wr
:
ok
=
true
ok
=
true
case
<-
wr
.
ctx
.
Done
()
:
case
<-
wr
.
ctx
.
Done
()
:
wgs
.
stopIfEmpty
()
case
<-
donec
:
case
<-
donec
:
if
wgs
.
closeErr
!=
nil
{
if
wgs
.
closeErr
!=
nil
{
closeCh
<-
WatchResponse
{
closeErr
:
wgs
.
closeErr
}
closeCh
<-
WatchResponse
{
closeErr
:
wgs
.
closeErr
}
...
@@ -352,15 +354,19 @@ func (w *watchGrpcStream) addStream(resp *pb.WatchResponse, pendingReq *watchReq
...
@@ -352,15 +354,19 @@ func (w *watchGrpcStream) addStream(resp *pb.WatchResponse, pendingReq *watchReq
go
w
.
serveStream
(
ws
)
go
w
.
serveStream
(
ws
)
}
}
// closeStream closes the watcher resources and removes it
func
(
w
*
watchGrpcStream
)
closeStream
(
ws
*
watcherStream
)
bool
{
func
(
w
*
watchGrpcStream
)
closeStream
(
ws
*
watcherStream
)
{
w
.
mu
.
Lock
()
w
.
mu
.
Lock
()
// cancels request stream; subscriber receives nil channel
// cancels request stream; subscriber receives nil channel
close
(
ws
.
initReq
.
retc
)
close
(
ws
.
initReq
.
retc
)
// close subscriber's channel
// close subscriber's channel
close
(
ws
.
outc
)
close
(
ws
.
outc
)
delete
(
w
.
streams
,
ws
.
id
)
delete
(
w
.
streams
,
ws
.
id
)
empty
:=
len
(
w
.
streams
)
==
0
if
empty
&&
w
.
stopc
!=
nil
{
w
.
stopc
=
nil
}
w
.
mu
.
Unlock
()
w
.
mu
.
Unlock
()
return
empty
}
}
// run is the root of the goroutines for managing a watcher client
// run is the root of the goroutines for managing a watcher client
...
@@ -464,6 +470,10 @@ func (w *watchGrpcStream) run() {
...
@@ -464,6 +470,10 @@ func (w *watchGrpcStream) run() {
cancelSet
=
make
(
map
[
int64
]
struct
{})
cancelSet
=
make
(
map
[
int64
]
struct
{})
case
<-
stopc
:
case
<-
stopc
:
return
return
case
ws
:=
<-
w
.
closingc
:
if
w
.
closeStream
(
ws
)
{
return
}
}
}
// send failed; queue for retry
// send failed; queue for retry
...
@@ -522,6 +532,15 @@ func (w *watchGrpcStream) serveWatchClient(wc pb.Watch_WatchClient) {
...
@@ -522,6 +532,15 @@ func (w *watchGrpcStream) serveWatchClient(wc pb.Watch_WatchClient) {
// serveStream forwards watch responses from run() to the subscriber
// serveStream forwards watch responses from run() to the subscriber
func
(
w
*
watchGrpcStream
)
serveStream
(
ws
*
watcherStream
)
{
func
(
w
*
watchGrpcStream
)
serveStream
(
ws
*
watcherStream
)
{
defer
func
()
{
// signal that this watcherStream is finished
select
{
case
w
.
closingc
<-
ws
:
case
<-
w
.
donec
:
w
.
closeStream
(
ws
)
}
}()
var
closeErr
error
var
closeErr
error
emptyWr
:=
&
WatchResponse
{}
emptyWr
:=
&
WatchResponse
{}
wrs
:=
[]
*
WatchResponse
{}
wrs
:=
[]
*
WatchResponse
{}
...
@@ -602,20 +621,9 @@ func (w *watchGrpcStream) serveStream(ws *watcherStream) {
...
@@ -602,20 +621,9 @@ func (w *watchGrpcStream) serveStream(ws *watcherStream) {
}
}
}
}
w
.
closeStream
(
ws
)
w
.
stopIfEmpty
()
// lazily send cancel message if events on missing id
// lazily send cancel message if events on missing id
}
}
func
(
wgs
*
watchGrpcStream
)
stopIfEmpty
()
{
wgs
.
mu
.
Lock
()
if
len
(
wgs
.
streams
)
==
0
&&
wgs
.
stopc
!=
nil
{
close
(
wgs
.
stopc
)
wgs
.
stopc
=
nil
}
wgs
.
mu
.
Unlock
()
}
func
(
w
*
watchGrpcStream
)
newWatchClient
()
(
pb
.
Watch_WatchClient
,
error
)
{
func
(
w
*
watchGrpcStream
)
newWatchClient
()
(
pb
.
Watch_WatchClient
,
error
)
{
ws
,
rerr
:=
w
.
resume
()
ws
,
rerr
:=
w
.
resume
()
if
rerr
!=
nil
{
if
rerr
!=
nil
{
...
...
vendor/github.com/coreos/etcd/rafthttp/stream.go
View file @
a8dbab66
...
@@ -49,6 +49,7 @@ var (
...
@@ -49,6 +49,7 @@ var (
"2.1.0"
:
{
streamTypeMsgAppV2
,
streamTypeMessage
},
"2.1.0"
:
{
streamTypeMsgAppV2
,
streamTypeMessage
},
"2.2.0"
:
{
streamTypeMsgAppV2
,
streamTypeMessage
},
"2.2.0"
:
{
streamTypeMsgAppV2
,
streamTypeMessage
},
"2.3.0"
:
{
streamTypeMsgAppV2
,
streamTypeMessage
},
"2.3.0"
:
{
streamTypeMsgAppV2
,
streamTypeMessage
},
"3.0.0"
:
{
streamTypeMsgAppV2
,
streamTypeMessage
},
}
}
)
)
...
...
vendor/github.com/coreos/etcd/version/version.go
View file @
a8dbab66
...
@@ -29,7 +29,7 @@ import (
...
@@ -29,7 +29,7 @@ import (
var
(
var
(
// MinClusterVersion is the min cluster version this etcd binary is compatible with.
// MinClusterVersion is the min cluster version this etcd binary is compatible with.
MinClusterVersion
=
"2.3.0"
MinClusterVersion
=
"2.3.0"
Version
=
"3.0.
9
"
Version
=
"3.0.
10
"
// Git SHA Value will be set during build
// Git SHA Value will be set during build
GitSHA
=
"Not provided (use ./build instead of go build)"
GitSHA
=
"Not provided (use ./build instead of go build)"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment