Skip to content

Commit 2a811e3

Browse files
author
iwysiu
committed
GODRIVER-1224 fix race condition in topology.pool
Change-Id: Ib283caf6e786a0e0636a9e462c12a0e8c395dbcd
1 parent e25bb90 commit 2a811e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

x/mongo/driver/topology/pool.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ func (p *pool) makeNewConnection(ctx context.Context) (*connection, string, erro
270270

271271
c.pool = p
272272
c.poolID = atomic.AddUint64(&p.nextid, 1)
273-
c.generation = p.generation
273+
c.generation = atomic.LoadUint64(&p.generation)
274274

275275
if p.monitor != nil {
276276
p.monitor.Event(&event.PoolEvent{

0 commit comments

Comments
 (0)