fix: fix deadlock of mappingQuery on context canceled

Fixes #11078

replace bare channel send with SendCtx so that we properly shut down when context is canceled.
This commit is contained in:
Spike Curtis
2023-12-07 17:19:18 +04:00
committed by GitHub
parent 941e3873a8
commit b34ecf1e9e
+1 -2
View File
@@ -941,8 +941,7 @@ func (q *querier) mappingQuery(peer mKey) error {
return nil
}
logger.Debug(q.ctx, "sending mappings", slog.F("mapping_len", len(mappings)))
mpr.mappings <- mappings
return nil
return agpl.SendCtx(q.ctx, mpr.mappings, mappings)
}
func (q *querier) bindingsToMappings(bindings []database.GetTailnetTunnelPeerBindingsRow) ([]mapping, error) {