Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AsyncMethodsDropsStateMachineAndExecutionContextUponCompletion fails with timeout #56359

Closed
kunalspathak opened this issue Jul 27, 2021 · 7 comments · Fixed by #56384
Closed

Comments

@kunalspathak
Copy link
Member

System.Threading.Tasks.Tests.AsyncTaskMethodBuilderTests.AsyncMethodsDropsStateMachineAndExecutionContextUponCompletion fails with timeout. Below is the query where it failed in last 14 days.

https://runfo.azurewebsites.net/search/tests/?q=started%3A%7E14+definition%3A686+kind%3Arolling+name%3A%22system.threading.tasks.tests+work+item%22

I didn't go in detail but the call stack looks similar to #30122.
cc: @stephentoub

Process terminated. Look at the created dump
   at System.Environment.FailFast(System.String, System.Exception)
   at System.Threading.Tasks.Tests.AsyncTaskMethodBuilderTests+<AsyncMethodsDropsStateMachineAndExecutionContextUponCompletion>d__32.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Threading.Tasks.Tests.AsyncTaskMethodBuilderTests+<AsyncMethodsDropsStateMachineAndExecutionContextUponCompletion>d__32, System.Threading.Tasks.Tests, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]].ExecutionContextCallback(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Threading.Tasks.Tests.AsyncTaskMethodBuilderTests+<AsyncMethodsDropsStateMachineAndExecutionContextUponCompletion>d__32, System.Threading.Tasks.Tests, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]].MoveNext(System.Threading.Thread)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Threading.Tasks.Tests.AsyncTaskMethodBuilderTests+<AsyncMethodsDropsStateMachineAndExecutionContextUponCompletion>d__32, System.Threading.Tasks.Tests, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]].MoveNext()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Runtime.CompilerServices.IAsyncStateMachineBox, Boolean)
   at System.Threading.Tasks.Task.RunContinuations(System.Object)
   at System.Threading.Tasks.Task.FinishStageTwo()
   at System.Threading.Tasks.Task.FinishSlow(Boolean)
   at System.Threading.Tasks.Task.TrySetException(System.Object)
   at System.Threading.Tasks.Task+CancellationPromise`1+<>c[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].<.ctor>b__3_0(System.Object)
   at System.Threading.TimerQueueTimer.CallCallback(Boolean)
   at System.Threading.TimerQueueTimer.Fire(Boolean)
   at System.Threading.TimerQueue.FireNextTimers()
   at System.Threading.TimerQueue.AppDomainTimerCallback(Int32)
   at System.Threading.UnmanagedThreadPoolWorkItem.System.Threading.IThreadPoolWorkItem.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool+WorkerThread.WorkerThreadStart()
   at System.Threading.Thread.StartCallback()
System.TimeoutException: The operation has timed out.
   at System.Threading.Tasks.Tests.AsyncTaskMethodBuilderTests.AsyncMethodsDropsStateMachineAndExecutionContextUponCompletion() in /_/src/libraries/System.Threading.Tasks/tests/System.Runtime.CompilerServices/AsyncTaskMethodBuilderTests.cs:line 567----- end Wed 07/21/2021  7:15:00.29 ----- exit code -2146232797 -
@dotnet-issue-labeler dotnet-issue-labeler bot added area-System.Threading untriaged New issue has not been triaged by the area owner labels Jul 27, 2021
@ghost
Copy link

ghost commented Jul 27, 2021

Tagging subscribers to this area: @mangod9
See info in area-owners.md if you want to be subscribed.

Issue Details

System.Threading.Tasks.Tests.AsyncTaskMethodBuilderTests.AsyncMethodsDropsStateMachineAndExecutionContextUponCompletion fails with timeout. Below is the query where it failed in last 14 days.

https://runfo.azurewebsites.net/search/tests/?q=started%3A%7E14+definition%3A686+kind%3Arolling+name%3A%22system.threading.tasks.tests+work+item%22

I didn't go in detail but the call stack looks similar to #30122.
cc: @stephentoub

Process terminated. Look at the created dump
   at System.Environment.FailFast(System.String, System.Exception)
   at System.Threading.Tasks.Tests.AsyncTaskMethodBuilderTests+<AsyncMethodsDropsStateMachineAndExecutionContextUponCompletion>d__32.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Threading.Tasks.Tests.AsyncTaskMethodBuilderTests+<AsyncMethodsDropsStateMachineAndExecutionContextUponCompletion>d__32, System.Threading.Tasks.Tests, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]].ExecutionContextCallback(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Threading.Tasks.Tests.AsyncTaskMethodBuilderTests+<AsyncMethodsDropsStateMachineAndExecutionContextUponCompletion>d__32, System.Threading.Tasks.Tests, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]].MoveNext(System.Threading.Thread)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Threading.Tasks.Tests.AsyncTaskMethodBuilderTests+<AsyncMethodsDropsStateMachineAndExecutionContextUponCompletion>d__32, System.Threading.Tasks.Tests, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]].MoveNext()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Runtime.CompilerServices.IAsyncStateMachineBox, Boolean)
   at System.Threading.Tasks.Task.RunContinuations(System.Object)
   at System.Threading.Tasks.Task.FinishStageTwo()
   at System.Threading.Tasks.Task.FinishSlow(Boolean)
   at System.Threading.Tasks.Task.TrySetException(System.Object)
   at System.Threading.Tasks.Task+CancellationPromise`1+<>c[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].<.ctor>b__3_0(System.Object)
   at System.Threading.TimerQueueTimer.CallCallback(Boolean)
   at System.Threading.TimerQueueTimer.Fire(Boolean)
   at System.Threading.TimerQueue.FireNextTimers()
   at System.Threading.TimerQueue.AppDomainTimerCallback(Int32)
   at System.Threading.UnmanagedThreadPoolWorkItem.System.Threading.IThreadPoolWorkItem.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool+WorkerThread.WorkerThreadStart()
   at System.Threading.Thread.StartCallback()
System.TimeoutException: The operation has timed out.
   at System.Threading.Tasks.Tests.AsyncTaskMethodBuilderTests.AsyncMethodsDropsStateMachineAndExecutionContextUponCompletion() in /_/src/libraries/System.Threading.Tasks/tests/System.Runtime.CompilerServices/AsyncTaskMethodBuilderTests.cs:line 567----- end Wed 07/21/2021  7:15:00.29 ----- exit code -2146232797 -
Author: kunalspathak
Assignees: -
Labels:

area-System.Threading, untriaged

Milestone: -

@mangod9
Copy link
Member

mangod9 commented Jul 27, 2021

@kouvel, is this another case of what is being fixed in #56346?

@mangod9 mangod9 removed the untriaged New issue has not been triaged by the area owner label Jul 27, 2021
@mangod9 mangod9 added this to the 6.0.0 milestone Jul 27, 2021
@kouvel
Copy link
Member

kouvel commented Jul 27, 2021

Yes this looks like the same issue as #55642, closing as duplicate

@kouvel kouvel closed this as completed Jul 27, 2021
@stephentoub
Copy link
Member

Yes this looks like the same issue as #55642, closing as duplicate

Are you sure? There aren't any Task.Waits in this test, nor do I see any queued work items to the thread pool in the dump.

I recently re-enabled this test in #56007.

@stephentoub
Copy link
Member

One of the dumps shows:

Statistics for all finalizable objects that are no longer rooted:
              MT    Count    TotalSize Class Name
00007ffe58fae498        1           24 System.Threading.Tasks.Tests.InvokeActionOnFinalization

which suggests the test may just need for force another collection. I'll try submitting a PR with that.

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jul 27, 2021
@kunalspathak kunalspathak reopened this Jul 27, 2021
@kouvel
Copy link
Member

kouvel commented Jul 27, 2021

Are you sure? There aren't any Task.Waits in this test, nor do I see any queued work items to the thread pool in the dump.

Oh you're right, I thought I saw some thread requests pending but I was mistaken

@ghost
Copy link

ghost commented Jul 27, 2021

Tagging subscribers to this area: @dotnet/area-system-threading-tasks
See info in area-owners.md if you want to be subscribed.

Issue Details

System.Threading.Tasks.Tests.AsyncTaskMethodBuilderTests.AsyncMethodsDropsStateMachineAndExecutionContextUponCompletion fails with timeout. Below is the query where it failed in last 14 days.

https://runfo.azurewebsites.net/search/tests/?q=started%3A%7E14+definition%3A686+kind%3Arolling+name%3A%22system.threading.tasks.tests+work+item%22

I didn't go in detail but the call stack looks similar to #30122.
cc: @stephentoub

Process terminated. Look at the created dump
   at System.Environment.FailFast(System.String, System.Exception)
   at System.Threading.Tasks.Tests.AsyncTaskMethodBuilderTests+<AsyncMethodsDropsStateMachineAndExecutionContextUponCompletion>d__32.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Threading.Tasks.Tests.AsyncTaskMethodBuilderTests+<AsyncMethodsDropsStateMachineAndExecutionContextUponCompletion>d__32, System.Threading.Tasks.Tests, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]].ExecutionContextCallback(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Threading.Tasks.Tests.AsyncTaskMethodBuilderTests+<AsyncMethodsDropsStateMachineAndExecutionContextUponCompletion>d__32, System.Threading.Tasks.Tests, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]].MoveNext(System.Threading.Thread)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Threading.Tasks.Tests.AsyncTaskMethodBuilderTests+<AsyncMethodsDropsStateMachineAndExecutionContextUponCompletion>d__32, System.Threading.Tasks.Tests, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]].MoveNext()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Runtime.CompilerServices.IAsyncStateMachineBox, Boolean)
   at System.Threading.Tasks.Task.RunContinuations(System.Object)
   at System.Threading.Tasks.Task.FinishStageTwo()
   at System.Threading.Tasks.Task.FinishSlow(Boolean)
   at System.Threading.Tasks.Task.TrySetException(System.Object)
   at System.Threading.Tasks.Task+CancellationPromise`1+<>c[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].<.ctor>b__3_0(System.Object)
   at System.Threading.TimerQueueTimer.CallCallback(Boolean)
   at System.Threading.TimerQueueTimer.Fire(Boolean)
   at System.Threading.TimerQueue.FireNextTimers()
   at System.Threading.TimerQueue.AppDomainTimerCallback(Int32)
   at System.Threading.UnmanagedThreadPoolWorkItem.System.Threading.IThreadPoolWorkItem.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool+WorkerThread.WorkerThreadStart()
   at System.Threading.Thread.StartCallback()
System.TimeoutException: The operation has timed out.
   at System.Threading.Tasks.Tests.AsyncTaskMethodBuilderTests.AsyncMethodsDropsStateMachineAndExecutionContextUponCompletion() in /_/src/libraries/System.Threading.Tasks/tests/System.Runtime.CompilerServices/AsyncTaskMethodBuilderTests.cs:line 567----- end Wed 07/21/2021  7:15:00.29 ----- exit code -2146232797 -
Author: kunalspathak
Assignees: -
Labels:

area-System.Threading.Tasks, in pr

Milestone: 6.0.0

@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jul 27, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Aug 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants