Skip to content

meowing in the general direction of the MC to see if it stops exploding the server #6257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 52 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
906d47a
meow
Absolucy Apr 8, 2025
6cc514b
try that
Absolucy Apr 8, 2025
19906f8
e
Absolucy Apr 8, 2025
a3e4dd1
vanderlin prolly removed that for a reason
Absolucy Apr 8, 2025
83a9be3
var so i can fix that to test things
Absolucy Apr 8, 2025
63c781e
a
Absolucy Apr 8, 2025
4559f28
e
Absolucy Apr 8, 2025
169d5ad
keep track of tick usage
Absolucy Apr 8, 2025
b3527c5
re-enable enqueue logging for now
Absolucy Apr 8, 2025
e4387f8
guh
Absolucy Apr 8, 2025
17f7da3
guh 2: electric boogaloo
Absolucy Apr 8, 2025
e7a21fd
Merge branch 'master' of github.com:Monkestation/Monkestation2.0 into…
Absolucy Apr 8, 2025
dc9e8bb
Merge branch 'master' of github.com:Monkestation/Monkestation2.0 into…
Absolucy Apr 10, 2025
7b44be5
revert changes made
Absolucy Apr 10, 2025
2d5665a
and now port https://github.com/dwasint/Vanderlin/commit/24780cded607…
Absolucy Apr 10, 2025
bbc4ed6
forgot that, that's important
Absolucy Apr 10, 2025
3202e6c
anjd that
Absolucy Apr 10, 2025
43f2651
Merge branch 'master' of github.com:Monkestation/Monkestation2.0 into…
Absolucy Apr 12, 2025
27e70c6
re-add `ENQUEUE_SANITY`
Absolucy Apr 12, 2025
0d566b2
e
Absolucy Apr 12, 2025
a386db6
i am stupid
Absolucy Apr 12, 2025
b01682f
rwuhjuheryghurygehbreerhb
Absolucy Apr 12, 2025
b2f42d1
Merge branch 'master' of github.com:Monkestation/Monkestation2.0 into…
Absolucy Apr 12, 2025
bd65b76
aeiou
Absolucy Apr 12, 2025
844a9be
also stack_trace that
Absolucy Apr 12, 2025
a1f0d14
actually fuck it remove that for now
Absolucy Apr 12, 2025
8f31172
Merge branch 'master' of github.com:Monkestation/Monkestation2.0 into…
Absolucy Apr 13, 2025
d2118be
Port https://github.com/Vanderlin-Tales-Of-Wine/Vanderlin/pull/1262/c…
Absolucy Apr 13, 2025
8c19a3d
re-add enqueue logging
Absolucy Apr 14, 2025
11d446f
byeah
Absolucy Apr 14, 2025
a4e748e
e
Absolucy Apr 14, 2025
0783e8d
Merge branch 'master' of github.com:Monkestation/Monkestation2.0 into…
Absolucy Apr 15, 2025
a2d60f5
some debug stuff
Absolucy Apr 15, 2025
fae7aca
a
Absolucy Apr 15, 2025
664ac77
GLOB.force_mc_soft_reset
Absolucy Apr 15, 2025
001f724
STOP SPAMMING DISCORD
Absolucy Apr 15, 2025
2e6918d
add "softreset" for plexora
Absolucy Apr 15, 2025
d95d98a
Merge branch 'master' of github.com:Monkestation/Monkestation2.0 into…
Absolucy Apr 15, 2025
65effaa
Merge branch 'master' of github.com:Monkestation/Monkestation2.0 into…
Absolucy Apr 18, 2025
1355add
try that?
Absolucy Apr 18, 2025
391122e
e
Absolucy Apr 19, 2025
4b9026d
Revert "e"
Absolucy Apr 19, 2025
e73745b
Reapply "e"
Absolucy Apr 19, 2025
bc04eb8
extra checks
Absolucy Apr 19, 2025
912cdc5
Revert "extra checks"
Absolucy Apr 20, 2025
8c97f7e
Revert "Reapply "e""
Absolucy Apr 20, 2025
5f85326
Merge branch 'master' of github.com:Monkestation/Monkestation2.0 into…
Absolucy Apr 20, 2025
4f55a8d
Merge branch 'master' of https://github.com/Monkestation/Monkestation…
Absolucy Apr 26, 2025
acb00fc
no more soft resets. also send plexora messages without spamming.
Absolucy Apr 26, 2025
c7ad698
wait shit
Absolucy Apr 26, 2025
da069e7
fix that
Absolucy Apr 27, 2025
dfdce7e
what the shitfuck?
Absolucy Apr 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion code/__DEFINES/~monkestation/logging.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#define LOG_CATEGORY_GAME_LOOC "game-looc"
#define LOG_CATEGORY_STORYTELLER "storyteller"
/* #define LOG_CATEGORY_ENQUEUE "enqueue" */

#ifdef ENABLE_ENQUEUE_LOGGING
#define LOG_CATEGORY_ENQUEUE "enqueue"
#endif
4 changes: 2 additions & 2 deletions code/__HELPERS/logging/debug.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
#endif
SEND_TEXT(world.log, text)

/*
#ifdef ENABLE_ENQUEUE_LOGGING
/proc/log_enqueue(text, list/data)
logger.Log(LOG_CATEGORY_ENQUEUE, text, data)
*/
#endif
4 changes: 4 additions & 0 deletions code/controllers/master.dm
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ GLOBAL_REAL(Master, /datum/controller/master)
msg += "\t [varname] = [varval]\n"
log_world(msg)

/*
var/datum/controller/subsystem/BadBoy = Master.last_type_processed
var/FireHim = FALSE
if(istype(BadBoy))
Expand All @@ -188,10 +189,13 @@ GLOBAL_REAL(Master, /datum/controller/master)
if(msg)
to_chat(GLOB.admins, span_boldannounce("[msg]"))
log_world(msg)
*/

if (istype(Master.subsystems))
/*
if(FireHim)
Master.subsystems += new BadBoy.type //NEW_SS_GLOBAL will remove the old one
*/
subsystems = Master.subsystems
current_runlevel = Master.current_runlevel
StartProcessing(10)
Expand Down
51 changes: 43 additions & 8 deletions code/controllers/subsystem.dm
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,17 @@
/// Previous subsystem in the queue of subsystems to run this tick
var/datum/controller/subsystem/queue_prev

/*
var/avg_iter_count = 0
var/avg_drift = 0
/* var/list/enqueue_log = list() */
*/

STATIC_COOLDOWN_DECLARE(plexora_alert_cooldown)
var/static/list/queued_plexora_alerts

#ifdef ENABLE_ENQUEUE_LOGGING
var/list/enqueue_log = list()
#endif

//Do not blindly add vars here to the bottom, put it where it goes above
//If your var only has two values, put it in as a flag.
Expand Down Expand Up @@ -197,27 +205,52 @@

var/iter_count = 0

/* enqueue_log.Cut() */
#ifdef ENABLE_ENQUEUE_LOGGING
enqueue_log.Cut()
#endif
for (queue_node = Master.queue_head; queue_node; queue_node = queue_node.queue_next)
iter_count++
if(iter_count >= ENQUEUE_SANITY)
/* log_enqueue(msg, list("enqueue_log" = enqueue_log.Copy())) */
SSplexora.mc_alert("[src] has likely entered an infinite loop in enqueue(), we're restarting the MC immediately!")
stack_trace("enqueue() entered an infinite loop, we're restarting the MC!")
/* enqueue_log.Cut() */
#ifdef ENABLE_ENQUEUE_LOGGING
log_enqueue(msg, list("enqueue_log" = enqueue_log.Copy()))
#endif
var/base_msg = "[src] (node = [queue_node], prev = [queue_node.queue_prev], next = [queue_node.queue_next])"
if(COOLDOWN_FINISHED(src, plexora_alert_cooldown))
var/list/lines = list()
if(LAZYLEN(queued_plexora_alerts))
lines += "[LAZYLEN(queued_plexora_alerts) + 1] enqueue loops have occured within the past minute."
lines += "## Details"
lines += " - [base_msg]"
for(var/queued_msg in queued_plexora_alerts)
lines += " - [queued_msg]"
LAZYNULL(queued_plexora_alerts)
else
lines += "MC restart triggered due to enqueue loop."
lines += "## Details"
lines += base_msg
SSplexora.mc_alert(jointext(lines, "\n"))
COOLDOWN_START(src, plexora_alert_cooldown, 1 MINUTES)
else
LAZYADD(queued_plexora_alerts, "[src] (node = [queue_node], prev = [queue_node.queue_prev], next = [queue_node.queue_next])")
stack_trace("MC restart triggered due to enqueue loop. Details: [base_msg]")
#ifdef ENABLE_ENQUEUE_LOGGING
enqueue_log.Cut()
#endif
Recreate_MC()
return


queue_node_priority = queue_node.queued_priority
queue_node_flags = queue_node.flags

/* enqueue_log["[iter_count]"] = list(
#ifdef ENABLE_ENQUEUE_LOGGING
enqueue_log["[iter_count]"] = list(
"node" = "[queue_node]",
"next" = "[queue_node.queue_next || "(none)"]",
"priority" = queue_node_priority,
"flags" = queue_node_flags,
) */
)
#endif

if (queue_node_flags & (SS_TICKER|SS_BACKGROUND) == SS_TICKER)
if ((SS_flags & (SS_TICKER|SS_BACKGROUND)) != SS_TICKER)
Expand All @@ -239,10 +272,12 @@
if (queue_node_priority < SS_priority)
break

/*
if(iter_count > 0)
avg_iter_count = avg_iter_count ? ((avg_iter_count + iter_count) * 0.5) : iter_count
var/drift = RELATIVE_ERROR(iter_count, avg_iter_count)
avg_drift = avg_drift ? ((drift + avg_drift) * 0.5) : drift
*/

queued_time = world.time
queued_priority = SS_priority
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
#ifdef ENABLE_ENQUEUE_LOGGING
/datum/log_category/debug_enqueue
category = LOG_CATEGORY_ENQUEUE
debugger_visible = TRUE
*/
#endif
Loading