Skip to content

Commit

Permalink
fix connection leak in the mongodb module (elastic#5711)
Browse files Browse the repository at this point in the history
Signed-off-by: Shijiang Wei <[email protected]>
  • Loading branch information
mountkin authored and exekias committed Nov 27, 2017
1 parent ad4a54d commit b11ca76
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ https://github.com/elastic/beats/compare/v6.0.0-beta2...master[Check the HEAD di
- Fix the fetching of process information when some data is missing under MacOS X. {issue}5337[5337]
- Change `MySQL active connections` visualization title to `MySQL total connections`. {issue}4812[4812]
- Fix map overwrite in docker diskio module. {issue}5582[5582]
- Fix connection leak in mongodb module. {issue}5688[5688]

*Packetbeat*

Expand Down
1 change: 1 addition & 0 deletions metricbeat/module/mongodb/dbstats/dbstats.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func (m *MetricSet) Fetch() ([]common.MapStr, error) {
if err != nil {
return nil, err
}
defer mongoSession.Close()

// Get the list of databases names, which we'll use to call db.stats() on each
dbNames, err := mongoSession.DatabaseNames()
Expand Down
1 change: 1 addition & 0 deletions metricbeat/module/mongodb/status/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ func (m *MetricSet) Fetch() (common.MapStr, error) {
if err != nil {
return nil, err
}
defer mongoSession.Close()

result := map[string]interface{}{}
if err := mongoSession.DB("admin").Run(bson.D{{Name: "serverStatus", Value: 1}}, &result); err != nil {
Expand Down

0 comments on commit b11ca76

Please sign in to comment.