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

Repair (*Broadcaster).run goroutine leak #1958

Merged
merged 1 commit into from
Sep 30, 2017

Conversation

ityangchen
Copy link
Contributor

Repair (*Broadcaster).run goroutine leak

When execute 'docker swarm init' and 'docker swarm leave -f' on a node
repeatedly, the (*Broadcaster).run goroutine leak.

•What I did
Execute 'docker swarm init' and 'docker swarm leave -f' on a node
repeatedly

•How I did it
while true; do docker swarm init ; sleep 3 ; docker swarm leave -f ; done &

•How to verify it
'free -m', watch the 'available' item . constant loss explans the goroutine leak.

@codecov-io
Copy link

codecov-io commented Sep 28, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@1b42826). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1958   +/-   ##
=========================================
  Coverage          ?   37.94%           
=========================================
  Files             ?      137           
  Lines             ?    27309           
  Branches          ?        0           
=========================================
  Hits              ?    10363           
  Misses            ?    15673           
  Partials          ?     1273
Impacted Files Coverage Δ
networkdb/networkdb.go 60.11% <100%> (ø)

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 1b42826...71747b9. Read the comment docs.

@fcrisciani
Copy link

LGTM, can you actually squash all your commits into 1?

@fcrisciani fcrisciani requested a review from abhi September 29, 2017 03:29
@ityangchen
Copy link
Contributor Author

ok, I will squash them

When execute 'docker swarm init' and 'docker swarm leave -f' on a node
repeatedly, the (*Broadcaster).run goroutine leak.

Signed-off-by: yangchenliang <[email protected]>
Copy link
Contributor

@abhi abhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does broadcaster.Remove() takes care of this ? Or Should this be added in here ?
https://github.com/docker/libnetwork/blob/0bce3e17ca9572955e6b83d5b7431767492133c1/networkdb/watch.go#L86

@fcrisciani
Copy link

@abhi no the broadcaster is only one per networkdb and the Add/Remove allows you to add and remove listeners.
The close instead is the one that destroy the broadcaster and freed up the go routine that is dispatching events to listeners

@abhi
Copy link
Contributor

abhi commented Sep 29, 2017

@fcrisciani got it makes sense. LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants