Closed moreal closed 5 years ago
The fail was occurred by ThreadPool.QueueUserWorkItem
.
// expected
ActionExecutionState { CurrentPhase = 4, ExecutedBlockCount = 8, ExecutedBlockHash = 7e460070b002b8676f16dbee4b638027c639efc7def746b18ee971dd07861400, TotalBlockCount = 11 }, ActionExecutionState { CurrentPhase = 4, ExecutedBlockCount = 9, ExecutedBlockHash = f438f623ebb0d3ece603f2c380aa946dceeb97ebedac1fa244df12c6e42f0800, TotalBlockCount = 11 }, ActionExecutionState { CurrentPhase = 4, ExecutedBlockCount = 10, ExecutedBlockHash = 77b76146baf96433d6e81abb6e54dcb0975f91210348b257fdc332155c592100, TotalBlockCount = 11 },
// actual
ActionExecutionState { CurrentPhase = 4, ExecutedBlockCount = 9, ExecutedBlockHash = f438f623ebb0d3ece603f2c380aa946dceeb97ebedac1fa244df12c6e42f0800, TotalBlockCount = 11 }, ActionExecutionState { CurrentPhase = 4, ExecutedBlockCount = 8, ExecutedBlockHash = 7e460070b002b8676f16dbee4b638027c639efc7def746b18ee971dd07861400, TotalBlockCount = 11 }, ActionExecutionState { CurrentPhase = 4, ExecutedBlockCount = 10, ExecutedBlockHash = 77b76146baf96433d6e81abb6e54dcb0975f91210348b257fdc332155c592100, TotalBlockCount = 11 },
In implementation of Progress<T>.Report()
, it uses ThreadPool.QueueUserWorkItem
with handler we made, so we can't expect to get the states exactly sorted because of that.
Progress<T>.Report -> Progress<T>.OnReport -> SynchronizationContext.Post -> ThreadPool.QueueUserWorkItem