Reviewers: mp+219632_code.launchpad.net,
Message: Please take a look.
Description: replicaset: close cloned sessions
Not sure if this is related to test failures, but we should close cloned sessions anyway.
https://code.launchpad.net/~axwalk/juju-core/replicaset-close-clone/+merge/219632
(do not edit description out of merge proposal)
Please review this at https://codereview.appspot.com/92400043/
Affected files (+4, -0 lines): A [revision details] M replicaset/replicaset.go
Index: [revision details] === added file '[revision details]' --- [revision details] 2012-01-01 00:00:00 +0000 +++ [revision details] 2012-01-01 00:00:00 +0000 @@ -0,0 +1,2 @@ +Old revision: tarmac-20140515024948-mdinmvuq3nkxrxxi +New revision: <email address hidden>
Index: replicaset/replicaset.go === modified file 'replicaset/replicaset.go' --- replicaset/replicaset.go 2014-04-15 16:37:08 +0000 +++ replicaset/replicaset.go 2014-05-15 05:16:56 +0000 @@ -28,6 +28,7 @@ // details. func Initiate(session *mgo.Session, address, name string, tags map[string]string) error { monotonicSession := session.Clone() + defer monotonicSession.Close() monotonicSession.SetMode(mgo.Monotonic, true) cfg := Config{ Name: name, @@ -276,6 +277,7 @@ func CurrentConfig(session *mgo.Session) (*Config, error) { cfg := &Config{} monotonicSession := session.Clone() + defer monotonicSession.Close() monotonicSession.SetMode(mgo.Monotonic, true) err := monotonicSession.DB("local").C("system.replset").Find(nil).One(cfg) if err == mgo.ErrNotFound {
« Back to merge proposal
Reviewers: mp+219632_ code.launchpad. net,
Message:
Please take a look.
Description:
replicaset: close cloned sessions
Not sure if this is related to test failures,
but we should close cloned sessions anyway.
https:/ /code.launchpad .net/~axwalk/ juju-core/ replicaset- close-clone/ +merge/ 219632
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/92400043/
Affected files (+4, -0 lines): replicaset. go
A [revision details]
M replicaset/
Index: [revision details] 20140515024948- mdinmvuq3nkxrxx i
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-
+New revision: <email address hidden>
Index: replicaset/ replicaset. go replicaset. go' replicaset. go 2014-04-15 16:37:08 +0000 replicaset. go 2014-05-15 05:16:56 +0000 n.Close( ) sion.SetMode( mgo.Monotonic, true) session *mgo.Session) (*Config, error) { n.Close( ) sion.SetMode( mgo.Monotonic, true) n.DB("local" ).C("system. replset" ).Find( nil).One( cfg)
=== modified file 'replicaset/
--- replicaset/
+++ replicaset/
@@ -28,6 +28,7 @@
// details.
func Initiate(session *mgo.Session, address, name string, tags
map[string]string) error {
monotonicSession := session.Clone()
+ defer monotonicSessio
monotonicSes
cfg := Config{
Name: name,
@@ -276,6 +277,7 @@
func CurrentConfig(
cfg := &Config{}
monotonicSession := session.Clone()
+ defer monotonicSessio
monotonicSes
err := monotonicSessio
if err == mgo.ErrNotFound {