From 67a92c1cf859a814c0a45728ea938be405e12906 Mon Sep 17 00:00:00 2001 From: Maciej Mensfeld Date: Mon, 21 Nov 2022 11:39:33 +0100 Subject: [PATCH] Make users buffer fully thread-safe Under intense threading usage, the `@@users` buffer will not be thread-safe fully. Details here: ref https://github.com/ruby-concurrency/concurrent-ruby/issues/970 --- www/board/agenda/daemon/channel.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/board/agenda/daemon/channel.rb b/www/board/agenda/daemon/channel.rb index 3b609ad88e..b26491ea5a 100644 --- a/www/board/agenda/daemon/channel.rb +++ b/www/board/agenda/daemon/channel.rb @@ -15,7 +15,7 @@ class Channel @@sockets = Concurrent::Map.new - @@users = Concurrent::Map.new {|map,key| map[key]=[]} + @@users = Concurrent::Map.new {|map,key| map.compute_if_absent(key) { [] } } begin FOUNDATION_BOARD = ASF::SVN['foundation_board']