From fc6e32a6915d2c77e2282e11029073b124ebf263 Mon Sep 17 00:00:00 2001 From: io mintz Date: Thu, 8 Oct 2020 13:34:56 +0000 Subject: [PATCH] stats: include shard count in shm name --- cogs/stats.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cogs/stats.py b/cogs/stats.py index 2ed58b1..4ad8802 100644 --- a/cogs/stats.py +++ b/cogs/stats.py @@ -34,7 +34,12 @@ class Stats(BotBinStats): # Use our user ID as part of the shm name # to allow running multiple instances of the bot on the same machine. - shm_name = f'emote-manager-{self.bot.user_id}' + # The shard count is incorporated to prevent the following situation: + # - Shard count is increased in the launcher script / unit file from 30 to 33 + # - All clusters are restarted + # - Clusters begin using the old 30-element-long list to store their shard counts, + # but because some clusters that haven't restarted yet are still using the old shlist. + shm_name = f'emote-manager-{self.bot.user_id}-{self.bot.shard_count}' if self.is_opener(): seq = [0] * self.bot.shard_count try: