Fix premature harddel during hunt (#17163)

* Atomization

* wonder why we didn't found the references half of the time...

* dsf

---------

Co-authored-by: FluffyGhost <FluffyGhost>
This commit is contained in:
Fluffy
2023-08-28 22:05:37 +02:00
committed by GitHub
parent bc1189271e
commit f841ec5a8d
4 changed files with 76 additions and 3 deletions

View File

@@ -65,7 +65,16 @@ var/datum/controller/failsafe/Failsafe
FAILSAFE_MSG("Warning: DEFCON [defcon_pretty()]. The Master Controller has still not fired within the last [(5-defcon) * processing_interval] ticks. Killing and restarting...")
log_failsafe("MC has not fired within last [(5-defcon) * processing_interval] ticks, killing and restarting.")
--defcon
//Do not restart the MC if we are doing a REFERENCE_TRACKING hard lookup
#if !defined(GC_FAILURE_HARD_LOOKUP)
var/rtn = Recreate_MC()
#else
log_failsafe("MC was not actually recreated, because we're compiled with GC_FAILURE_HARD_LOOKUP")
FAILSAFE_MSG("MC was not actually recreated, because we're compiled with GC_FAILURE_HARD_LOOKUP")
var/rtn = TRUE
#endif
if(rtn > 0)
defcon = 4
master_iteration = 0
@@ -77,7 +86,16 @@ var/datum/controller/failsafe/Failsafe
//if the return number was 0, it just means the mc was restarted too recently, and it just needs some time before we try again
//no need to handle that specially when defcon 0 can handle it
if(0) //DEFCON 0! (mc failed to restart)
//Do not restart the MC if we are doing a REFERENCE_TRACKING hard lookup
#if !defined(GC_FAILURE_HARD_LOOKUP)
var/rtn = Recreate_MC()
#else
var/rtn = TRUE
log_failsafe("MC was not actually recreated, because we're compiled with GC_FAILURE_HARD_LOOKUP")
FAILSAFE_MSG("MC was not actually recreated, because we're compiled with GC_FAILURE_HARD_LOOKUP")
#endif
if(rtn > 0)
defcon = 4
master_iteration = 0

View File

@@ -126,9 +126,15 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
if(2)
msg = "The [BadBoy.name] subsystem was the last to fire for 2 controller restarts. It will be recovered now and disabled if it happens again."
FireHim = TRUE
//If we are running a REFERENCE_TRACKING with hard lookups, this is expected and we do not want the master controller
//to stop the garbage collector from working
#if !defined(GC_FAILURE_HARD_LOOKUP)
if(3)
msg = "The [BadBoy.name] subsystem seems to be destabilizing the MC and will be offlined."
BadBoy.flags |= SS_NO_FIRE
#endif
if(msg)
admin_notice("<span class='danger'>[msg]</span>", R_DEBUG | R_DEV)
log_subsystem_mastercontroller(msg)