"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "vendor/github.com/docker/swarmkit/manager/logbroker/subscription.go" between
moby-20.10.7.tar.gz and moby-20.10.8.tar.gz

About: Moby is a framework to assemble specialized container systems (formerly project name Docker; see here to clarify the relationship between the projects).

subscription.go  (moby-20.10.7):subscription.go  (moby-20.10.8)
skipping to change at line 207 skipping to change at line 207
for _, tid := range s.message.Selector.TaskIDs { for _, tid := range s.message.Selector.TaskIDs {
matchTasks[tid] = struct{}{} matchTasks[tid] = struct{}{}
} }
matchServices := map[string]struct{}{} matchServices := map[string]struct{}{}
for _, sid := range s.message.Selector.ServiceIDs { for _, sid := range s.message.Selector.ServiceIDs {
matchServices[sid] = struct{}{} matchServices[sid] = struct{}{}
} }
add := func(t *api.Task) { add := func(t *api.Task) {
// this mutex does not have a deferred unlock, because there is w
ork
// we need to do after we release it.
s.mu.Lock() s.mu.Lock()
defer s.mu.Unlock()
// Un-allocated task. // Un-allocated task.
if t.NodeID == "" { if t.NodeID == "" {
s.pendingTasks[t.ID] = struct{}{} s.pendingTasks[t.ID] = struct{}{}
s.mu.Unlock()
return return
} }
delete(s.pendingTasks, t.ID) delete(s.pendingTasks, t.ID)
if _, ok := s.nodes[t.NodeID]; !ok { if _, ok := s.nodes[t.NodeID]; !ok {
s.nodes[t.NodeID] = struct{}{} s.nodes[t.NodeID] = struct{}{}
s.mu.Unlock()
// if we try to call Publish before we release the lock,
we can end
// up in a situation where the receiver is trying to acqu
ire a read
// lock on it. it's hard to explain.
s.changed.Publish(s) s.changed.Publish(s)
return
} }
s.mu.Unlock()
} }
for { for {
var t *api.Task var t *api.Task
select { select {
case <-s.ctx.Done(): case <-s.ctx.Done():
return s.ctx.Err() return s.ctx.Err()
case event := <-ch: case event := <-ch:
switch v := event.(type) { switch v := event.(type) {
case api.EventCreateTask: case api.EventCreateTask:
 End of changes. 6 change blocks. 
1 lines changed or deleted 15 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)