Closed ferdinandhubbard981 closed 2 years ago
Try pressing q to quit the controller. This is because ctrl-c needs some separate code to intercept the SIGINT os signal, and then send the ControllerQuit RPC call.
Pressing q sends the ControllerQuit call
Do you think this is a cause of the tests failing? Do the tests exit cleanly each time?
Try pressing q to quit the controller. This is because ctrl-c needs some separate code to intercept the SIGINT os signal, and then send the ControllerQuit RPC call.
Pressing q sends the ControllerQuit call
Even with q there is an error
to reproduce: run broker, worker go run . press q result: broker crashes with error: panic: runtime error: invalid memory address or nil pointer dereference
The nil pointer dereference is because when the controller is removed, there exists the chance that when the pushstate block has the mutex, it tries to send to the non existent client
You could probably fix this with a check that controller is not nil in the push state block
to reproduce: cd broker go run .
in separate terminal: cd worker go run .
in separate terminal: go run . let the game run to completion (nothing is changing after each step) ctrl-c
go run .
result: nothing is changing after each step because gameState hasn't been reset.