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

Fix OnOpen/OnBeginOpen issues with custom channels #1571

Merged
merged 1 commit into from
Oct 10, 2016

Conversation

roncain
Copy link
Contributor

@roncain roncain commented Sep 28, 2016

Fixes the issue where OnOpen/OnBeginOpen and
OnClose/OnBeginClose were incorrectly called when
using custom channels.

Fixes the product issue by propagating knowledge of
sync and async open/close requests down the channel
stack so they stay sync or async based on the original
call.

Created mocks and unit tests for custom channels

READY FOR REVIEW NOW

Fixes #1544

@roncain roncain added PR DO NOT MERGE If for whatever reason you do not want a PR merged. and removed PR DO NOT MERGE If for whatever reason you do not want a PR merged. labels Sep 28, 2016
@@ -798,12 +903,10 @@ internal protected virtual Task OnCloseAsync(TimeSpan timeout)

internal protected virtual Task OnOpenAsync(TimeSpan timeout)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewers: doing a code coverage run reveals this and the virtual OnCloseAsync here in the base class now appears to be dead code. This is consistent with all WCF product code overriding this method, plus the fact the way we call external types doesn't use the code path that gets here. I'm contemplating a hard assert here that we should never get here, and then remove the body of these methods. Thoughts?

@@ -830,7 +933,7 @@ internal protected virtual Task OnOpenAsync(TimeSpan timeout)
}

// Calls the given Action asynchronously.
private async Task CallActionAsync<TArg>(Action<TArg> action, TArg argument)
internal static async Task CallActionAsync<TArg>(Action<TArg> action, TArg argument)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewers: I'm going to move this to TaskHelpers because it has no dependencies on CommunicationObject

@roncain
Copy link
Contributor Author

roncain commented Oct 3, 2016

Ping... any comments? From my perspective, this PR is complete. I'll squash out extra commits and rebase.

/cc: @zhenlan @iamjasonp @mconnew

@iamjasonp
Copy link
Member

In the cursory review I've done, I don't see anything that pops out... will take a closer look as time permits

Fixes the product issue by propagating knowledge of
sync and async open/close requests down the channel
stack so they stay sync or async based on the original
call.

Created mocks and unit tests for custom channels

Fixes dotnet#1544
@roncain roncain force-pushed the custom_channel_fix branch from 4fd6e8c to 96e0c4d Compare October 10, 2016 14:33
@roncain
Copy link
Contributor Author

roncain commented Oct 10, 2016

Ping -- any comments? I rebased and squashed. No changes have been made for the past 10 days.

Reminder: without this fix, the custom channel layer is broken. I have tested manually against NET Native, and of course all tests pass, including the ones added by this PR.

/cc: @zhenlan @mconnew @hongdai @StephenBonikowsky @KKhurin

@mconnew
Copy link
Member

mconnew commented Oct 10, 2016

:shipit:

@roncain roncain merged commit d92f922 into dotnet:master Oct 10, 2016
@roncain roncain deleted the custom_channel_fix branch October 10, 2016 19:01
@roncain
Copy link
Contributor Author

roncain commented Oct 10, 2016

Thanks @mconnew

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

Successfully merging this pull request may close these issues.

CommunicationObject.OnOpen and OnBeginOpen is never called
4 participants