HtheChemist/BitBurnerCentralManager

Runtime Error

Closed this issue · 2 comments

Sometimes I get after restart of Orchestrator this Runtime Error:

RUNTIME ERROR
/Orchestrator/Manager/ThreadManager.js@home

Cannot set properties of undefined (setting 'inUse')
stack:
TypeError: Cannot set properties of undefined (setting 'inUse')
at Object.freeThreads (/Orchestrator/Manager/ThreadManager.js:91:47)
at Module.main (/Orchestrator/Manager/ThreadManager.js:35:88)

I believe that this is due to a race condition that I have not been able to isolate yet.

I will look into it.

I found the bug. It was due to findIndex returning -1 (I though it was returning undefined), thus trying to deallocate a previously removed thread.