[LBBS-158] mod_discord: Hanging during module loads leaves modules lock held
Due to a recent Discord outage, the module correctly reloaded by itself due to connectivity failure, but perhaps due to not getting a reply, libconcord then hung, causing this thread to get stuck with the global modules lock held (with a WRLOCK), causing other issues elsewhere...
#1 __futex_abstimed_wait_common (futex_word=futex_word@entry=0x7fff88f52728, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@entry=0x0, private=private@entry=0, >
err = <optimized out>
clockbit = 256
op = 393
#2 0x00007fcd6b731f7b in __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word@entry=0x7fff88f52728, expected=expected@entry=0, clockid=clockid@entry=0, abstime=abstime@ent>
#3 0x00007fcd6b7345d8 in __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x562003034e88, cond=0x7fff88f52700) at ./nptl/pthread_cond_wait.c:503
spin = 0
buffer = {__routine = 0x7fcd6b734360 <__condvar_cleanup_waiting>, __arg = 0x7fff88f52660, __canceltype = 1665372255, __prev = 0x0}
cbuffer = {wseq = 0, cond = 0x7fff88f52700, mutex = 0x562003034e88, private = 0}
err = <optimized out>
g = 0
flags = <optimized out>
g1_start = <optimized out>
signals = <optimized out>
result = 0
wseq = 0
seq = 0
private = 0
#4 ___pthread_cond_wait (cond=0x7fff88f52700, mutex=0x562003034e88) at ./nptl/pthread_cond_wait.c:618
#5 0x00007fcd633b7956 in discord_request_begin () at /usr/local/lib/libdiscord.so.3.0
#6 0x00007fcd633b4d5a in discord_rest_run () at /usr/local/lib/libdiscord.so.3.0
#7 0x00007fcd633dbc3c in discord_get_current_user () at /usr/local/lib/libdiscord.so.3.0
#8 0x00007fcd633bae1f in _discord_init () at /usr/local/lib/libdiscord.so.3.0
#9 0x00007fcd633bcee8 in discord_from_config () at /usr/local/lib/libdiscord.so.3.0
#10 0x00007fcd69b6a89e in load_module () at mod_discord.c:1827
__func__ = "load_module"
#11 0x0000561fd59d09c9 in start_resource (mod=0x56200368f730) at module.c:802
Attempting to restart/start manually in the foreground, the following was observed with require=mod_discord.so in modules.conf:
[2026-05-08 20:41:28.208] === Registering module mod_discord
[2026-05-08 20:41:28.208] DEBUG[1465804]: mod_discord.c:1772 check_curl: Detected libcurl version 8.14.1
[2026-05-08 20:41:28.209] DEBUG[1465804]: config.c:455 config_parse_or_write: Parsing config /etc/lbbs/mod_discord.conf
[2026-05-08 20:41:28.209] DEBUG[1465804]: mod_discord.c:215 add_mapping: Adding 1:1 channel mapping for ...
49 20:41:37 CLIENT » ERROR discord-client.c:321: Couldn't fetch client's user object: Discord Ratelimit: You are being ratelimited (code 102)
50 20:41:37 CLIENT » FATAL discord-client.c:843: Couldn't initialize client: Discord Ratelimit: You are being ratelimited
[2026-05-08 20:41:37.694] ERROR[1465804]: mod_discord.c:1830 load_module: Failed to initialize Discord client using token
[2026-05-08 20:41:37.694] ERROR[1465804]: module.c:844 load_resource: Module 'mod_discord.so' could not be loaded.
[2026-05-08 20:41:37.694] ERROR[1465804]: module.c:1187 do_autoload_module: Aborting startup due to failing to load required module mod_discord.soComments
You must be logged in to leave a comment.