Skip to content

Commit

Permalink
Disable routes to "reload" using reload_modules(), due to errors.
Browse files Browse the repository at this point in the history
I happened to run the !!/reload command, which caused my test
instance to lock up. Further testing indicated intermittent results
from complaints from FindSpam:
 TypeError: To match, a rule must have either 'func' or 'regex' valid! : bad keyword in {}
causing a reboot to locking up, and at least some apparent correct
functionality.

I don't have the time to look into this at the moment. Given that
using the routes can cause a lockup, I've just disabled them. In
the cases of the two areas of the code where git changes might have
resulted in a reload_modules(), a full reboot will be performed.

The !!/reload command is just disabled. SD will say the command
doesn't exist.

autopull
  • Loading branch information
makyen committed May 19, 2022
1 parent b975a5e commit 5ad81f7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
11 changes: 7 additions & 4 deletions chatcommands.py
Expand Up @@ -1059,10 +1059,11 @@ def pull(alias_used='pull'):
state = ci_status["state"]
states.append(state)
if "success" in states:
if only_modules_changed(remote_diff):
if False and only_modules_changed(remote_diff):
# As of 2022-05-19, this causes at least intermittent failures and has been disabled.
GitManager.pull_remote()
reload_modules()
GlobalVars.reload()
reload_modules()
tell_rooms_with('debug', GlobalVars.s_norestart_findspam)
return
else:
Expand Down Expand Up @@ -1131,7 +1132,7 @@ def git(alias_used="git"):


# noinspection PyIncorrectDocstring,PyProtectedMember
@command(whole_msg=True, privileged=True, give_name=True, aliases=["restart", "reload"])
@command(whole_msg=True, privileged=True, give_name=True, aliases=["restart", "reload-disabled"])
def reboot(msg, alias_used="reboot"):
"""
Forces a system exit with exit code = 5
Expand All @@ -1143,7 +1144,9 @@ def reboot(msg, alias_used="reboot"):
("debug", (msg._client.host, msg.room.id)), ())
time.sleep(3)
exit_mode("reboot")
elif alias_used in {"reload"}:
elif False and alias_used in {"reload"}:
# As of 2022-05-19, this causes at least intermittent failures and has been disabled.
GlobalVars.reload()
reload_modules()
tell_rooms_with('debug', GlobalVars.s_norestart_findspam)
time.sleep(3)
Expand Down
3 changes: 2 additions & 1 deletion metasmoke.py
Expand Up @@ -294,7 +294,8 @@ def handle_websocket_data(data):
GlobalVars.reload()
findspam.FindSpam.reload_blacklists()
chatcommunicate.tell_rooms_with('debug', GlobalVars.s_norestart_blacklists)
elif only_modules_changed(remote_diff):
elif False and only_modules_changed(remote_diff):
# As of 2022-05-19, this causes at least intermittent failures and has been disabled.
GitManager.pull_remote()
if not GlobalVars.on_branch:
# Restart if HEAD detached
Expand Down

0 comments on commit 5ad81f7

Please sign in to comment.