Skip to content

Conversation

@AlekSi
Copy link
Contributor

@AlekSi AlekSi commented Jan 17, 2018

No description provided.

AlekSi and others added 23 commits October 17, 2017 19:04
* Disable pre-fetching (not needed on exporter queries), limit conn pool size and re-use database connection to MongoDB
* Remove .Ping() on exporter.mongoSess, mgo.Session will recreate the conn for us
* avoid race condition with sync.Mutex
* Use lock on close of mgo session also
* Use lock on close of mgo session also #2
* make pool limit a flag instead of hard-code
* default to 1 connection, it seems to work fine even at high volume
* Must return .Copy() of mgo.Session to avoid mgo deadlocking under concurrent calls. Moved session SocketTimeout to no longer be forever
* Must defer .Close() on copied mgo.Session from .getSession
* must check if != nil a 2nd time in getSession()
* Use mutex hat.
* Protect Close() with lock too.
* Count getSession() errors.
* Added query comments to .Find() queries in oplog_status.go, created shared/utils.go function to add comments, cleaned up duplicated code I made long ago
* shorten comment
@AlekSi AlekSi merged commit 01f0ef9 into master Jan 17, 2018
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.

5 participants