Skip to content

Commit 8854761

Browse files
authored
cherry-pick: channelz: fix race accessing channelMap without lock (#7079) (#7080)
1 parent e62770d commit 8854761

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/channelz/funcs.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ func RegisterSubChannel(pid int64, ref string) *SubChannel {
153153
RefName: ref,
154154
ID: id,
155155
sockets: make(map[int64]string),
156-
parent: db.channels[pid],
156+
parent: db.getChannel(pid),
157157
trace: &ChannelTrace{CreationTime: time.Now(), Events: make([]*traceEvent, 0, getMaxTraceEntry())},
158158
}
159159
db.addSubChannel(id, sc, pid)

0 commit comments

Comments
 (0)