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

AsyncInterceptor Forking Execution and Racing #34

Open
FGS-BMarkham opened this issue Jun 29, 2016 · 1 comment
Open

AsyncInterceptor Forking Execution and Racing #34

FGS-BMarkham opened this issue Jun 29, 2016 · 1 comment

Comments

@FGS-BMarkham
Copy link

I'm running into a situation where sometimes when execution passes through an async interceptor, execution splits into two threads of execution, which then race each other.

I've noticed that d84db87 introduces quite a bit of complication to async interceptors, which may be responsible for this bug, but I don't know enough about the original motivation of that change in order to surmise how the bug was introduced. From reading d84db87, it very much looks like the split execution is intentional, but that doesn't make much sense to me.

Help would be appreciated.

@FGS-BMarkham
Copy link
Author

If I roll my own version of AsyncInterceptor in which the tasks started by Task.Factory.StartNew(…) have .Wait() called on them after all the continuations are defined, my interceptors stop racing, which is good.

Unfortunately, the thread pool usage in this class still seems non-ideal (due to that being a rather limited resource in something like a web application), but I was unable to come up with a better overall design for the implementation of AsyncInterceptor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant