Call AsyncIteratorMethodBuilder.Complete before SetResult#47081
Call AsyncIteratorMethodBuilder.Complete before SetResult#47081jcouv merged 1 commit intodotnet:masterfrom
Conversation
|
FYI @stephentoub. Let me know if any second thoughts on this ordering. Thanks |
|
@cston @AlekseyTs @jaredpar for a second review. Thanks |
|
@jcouv, I'm fairly certain the new ordering is the right ordering, and I'm a little surprised it didn't fix the cited issue. Now that I'm back from being out, I'll find time to investigate the cited issue. Feel free to hold off on this until then if you don't mind having the open PR around. |
|
@stephentoub Okay. I'll mark the PR as draft for now. Feel free to use this branch (open Roslyn.sln, hit F5) to try the fix. |
|
@stephentoub Did you get a chance to take a look at the leak? Should I move forward with this change? Let me know if I can help. |
|
Thanks, Julien. Looking at it now. |
|
@jcouv, go ahead with this change. I finally made time with a debugger and figured out the problem. This PR is necessary but not sufficient. Will describe the problem in the dotnet/runtime#41187. |
|
@cston @AlekseyTs @jaredpar for a second review. Thanks |
While investigating a leak in async-iterator scenario, Stephen pointed out that we should call
AsynciteratorMethodBuilder.Completesooner (before notifying caller of result or exception).It doesn't looks like that's the cause of the leak, but is still worthwhile to fix.