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

Throwing a TaskCanceledException from WaitForStateChangedAsync is a poor design #13751

Closed
zhulika opened this issue Dec 13, 2017 · 1 comment
Closed

Comments

@zhulika
Copy link

zhulika commented Dec 13, 2017

The fact that you have chosen to cancel the task when it times out makes it very hard to use grpc in Windows because the output window floods with TaskCanceledException messages, I understand that so wish to claim that this is a feature specific to Visual Studio (#11328) but, if you want to say that you support Windows, I feel that you should conform to standard development environment for that operating system.

IMO, an "expected" condition, such as expiring code by reaching some sort of deadline should not throw an exception; exceptions are for exceptional (i.e. unexpected) conditions. In this case, I believe that the standard thing to do it to return a bool from this function and set it to false to indicate that it timed out. This the way that other similar functions in the .Net framework seem to behave.

@jtattermusch
Copy link
Contributor

Also see #13227

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

No branches or pull requests

3 participants