Closed rbx closed 1 year ago
The failures happen because there is a race:
Device::ResetWrapper()
is clearning the transports container.Control::RunShutdownSequence()
of a plugin is calling ChangeDeviceState(DeviceStateTransition::Auto);
, which leads Device::InterruptTransports();
via SubscribeToNewTransition(
.
So, one is accessing transports while the other is deleting it.For now just some notes:
case DeviceState::Binding:
case DeviceState::Connecting:
case DeviceState::InitializingTask:
case DeviceState::ResettingTask:
case DeviceState::ResettingDevice:
ChangeDeviceState(DeviceStateTransition::Auto);
, since those auto-transition anyway.
InterruptTransports
is not needed on the auto-transition from ResettingDevice, but the auto transitions should be disambiguated. So, one is accessing transports while the other is deleting it.
I guess we should synchronize those, shouldn't we?
So, one is accessing transports while the other is deleting it.
I guess we should synchronize those, shouldn't we?
Yeah. Also there is another race condition:
Solves #428.