diff --git a/TODO.md b/TODO.md index 7718bb19..68c70b53 100644 --- a/TODO.md +++ b/TODO.md @@ -5,8 +5,8 @@ - [ ] Pedantic state - [ ] brew, apt-get, rpm, chocately (windows) - [ ] Dynamic socket buffer sizes -- [ ] Switch to 1.4 and use maps vs hashmaps in sublist -- [ ] Sublist better at high concurrency +- [ ] Switch to 1.4/1.5 and use maps vs hashmaps in sublist +- [ ] Sublist better at high concurrency, cache uses writelock currently - [ ] Buffer pools/sync pools? - [ ] IOVec pools and writev for high fanout? - [ ] Add ability to reload config on signal diff --git a/server/monitor_sort_opts.go b/server/monitor_sort_opts.go index b91d1cf2..3959789d 100644 --- a/server/monitor_sort_opts.go +++ b/server/monitor_sort_opts.go @@ -53,7 +53,15 @@ func (d ByPending) Swap(i, j int) { d[i], d[j] = d[j], d[i] } func (d ByPending) Less(i, j int) bool { - return d[i].Val.bw.Buffered() < d[j].Val.bw.Buffered() + client := d[i].Val + client.mu.Lock() + bwi := client.bw.Buffered() + client.mu.Unlock() + client = d[j].Val + client.mu.Lock() + bwj := client.bw.Buffered() + client.mu.Unlock() + return bwi < bwj } type ByOutMsgs []Pair