mirror of
https://github.com/status-im/consul.git
synced 2025-02-19 17:14:37 +00:00
proxycfg: fix goroutine leak when service is re-registered (#14988)
Fixes a bug where we'd leak a goroutine in state.run when the given context was canceled while there was a pending update.
This commit is contained in:
parent
3a60885259
commit
f8b4b41205
@ -317,7 +317,10 @@ func (s *state) run(ctx context.Context, snap *ConfigSnapshot) {
|
|||||||
// This runs in another goroutine so we can't just do the send
|
// This runs in another goroutine so we can't just do the send
|
||||||
// directly here as access to snap is racy. Instead, signal the main
|
// directly here as access to snap is racy. Instead, signal the main
|
||||||
// loop above.
|
// loop above.
|
||||||
sendCh <- struct{}{}
|
select {
|
||||||
|
case sendCh <- struct{}{}:
|
||||||
|
case <-ctx.Done():
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user