fix: Fixes various crashes.

This commit is contained in:
Tera << 8 2025-01-08 11:40:42 -05:00
parent e456de9802
commit 7837334361
Signed by: imterah
GPG key ID: 8FA7DD57BA6CEA37

View file

@ -421,7 +421,12 @@ SchedulingLoop:
}
// Fetch response and close Channel
response := <-commandChannel
response, ok := <-commandChannel
if !ok {
return nil, fmt.Errorf("failed to read from command channel: recieved signal that is not OK")
}
close(commandChannel)
err, ok := response.(error)
@ -443,11 +448,11 @@ func (runtime *Runtime) cleanUpPendingCommandProcessingJobs() {
select {
case <-timeoutChannel:
log.Fatal("Message channel is likely running (timed out reading from it without an error)")
log.Warn("Message channel is likely running (timed out reading from it without an error)")
close(message.Channel)
case _, ok := <-message.Channel:
if ok {
log.Fatal("Message channel is running, but should be stopped (since message is NOT nil!)")
log.Warn("Message channel is running, but should be stopped (since message is NOT nil!)")
close(message.Channel)
}
}