Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add commander stopping sync mechanism (#352)
Resolves #256 Test that generates the data race: ```go func TestNewSupervisor(t *testing.T) { ... supervisor, err := NewSupervisor(&internal.NopLogger{}) assert.NoError(t, err) supervisor.Shutdown() } ``` It looks like the commander struct is started in a go routine when the `NewSupervisor` is created. The data race happens when the commander is stopped (`supervisor.Shutdown()`) while being initalized (Start). The fix adds a synchronization mechanism to prevent the commander being started if it is already being stopped.
- Loading branch information