Skip to content

Commit

Permalink
Merge pull request #703 from mreiferson/races_703
Browse files Browse the repository at this point in the history
nsqd: fix stats data race regression
  • Loading branch information
jehiah committed Jan 8, 2016
2 parents bc0a6b9 + e0ac1b2 commit 73ff4d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nsqd/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (n *NSQD) GetStats() []TopicStats {
}
n.RUnlock()
sort.Sort(TopicsByName{realTopics})
topics := make([]TopicStats, 0, len(n.topicMap))
topics := make([]TopicStats, 0, len(realTopics))
for _, t := range realTopics {
t.RLock()
realChannels := make([]*Channel, 0, len(t.channelMap))
Expand All @@ -132,7 +132,7 @@ func (n *NSQD) GetStats() []TopicStats {
}
t.RUnlock()
sort.Sort(ChannelsByName{realChannels})
channels := make([]ChannelStats, 0, len(t.channelMap))
channels := make([]ChannelStats, 0, len(realChannels))
for _, c := range realChannels {
c.RLock()
clients := make([]ClientStats, 0, len(c.clients))
Expand Down

0 comments on commit 73ff4d7

Please sign in to comment.