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

C# connectivity watcher causes lots of IDE output #13725

Closed
jskeet opened this issue Dec 12, 2017 · 1 comment
Closed

C# connectivity watcher causes lots of IDE output #13725

jskeet opened this issue Dec 12, 2017 · 1 comment
Assignees
Labels

Comments

@jskeet
Copy link
Contributor

jskeet commented Dec 12, 2017

Please answer these questions before submitting your issue.

What version of gRPC and what language are you using?

C# running in VS 15.5.1, targeting net461, tested with gRPC 1.7.3 and 1.8.0-pre2.

What operating system (Linux, Windows, …) and version?

Windows 10, with Creators Update

What runtime / compiler are you using (e.g. python version or version of gcc)

Visual Studio C# compiler

What did you do?

Project file:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net461</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Grpc.Core" Version="1.8.0-pre2" />
    <PackageReference Include="Grpc.Auth" Version="1.8.0-pre2" />
  </ItemGroup>
</Project>

Program file:

using Grpc.Auth;
using Grpc.Core;
using System;

class Program
{
    static void Main()
    {
        var endpoint = "datastore.googleapis.com:443";
        var auth = GoogleGrpcCredentials.GetApplicationDefaultAsync().Result;
        var channel = new Channel(endpoint, auth);
        Console.ReadLine();
        GC.KeepAlive(channel);
    }
}

Run in the debugger - it doesn't matter whether it's a Release or Debug configuration build.

What did you expect to see?

Relatively little output in the VS Output window

What did you see instead?

Once per second:

Exception thrown: 'System.Threading.Tasks.TaskCanceledException' in mscorlib.dll

If the TaskCanceledException is set to "break when thrown", the stack trace shows:

mscorlib.dll!System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task task)
mscorlib.dll!System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task task)
Grpc.Core.dll!Grpc.Core.Channel.RunConnectivityWatcherAsync()	Unknown	No symbols loaded.
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)
mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run()
mscorlib.dll!System.Runtime.CompilerServices.AsyncMethodBuilderCore.OutputAsyncCausalityEvents.AnonymousMethod__0()
mscorlib.dll!System.Runtime.CompilerServices.TaskAwaiter.OutputWaitEtwEvents.AnonymousMethod__0()
mscorlib.dll!System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action action, bool allowInlining, ref System.Threading.Tasks.Task currentTask)
mscorlib.dll!System.Threading.Tasks.Task.FinishContinuations()
mscorlib.dll!System.Threading.Tasks.Task<System.__Canon>.TrySetCanceled(System.Threading.CancellationToken tokenToRecord, object cancellationException)
mscorlib.dll!System.Threading.Tasks.TaskCompletionSource<object>.TrySetCanceled(System.Threading.CancellationToken cancellationToken)
mscorlib.dll!System.Threading.Tasks.TaskCompletionSource<System.__Canon>.SetCanceled()
Grpc.Core.dll!Grpc.Core.Internal.BatchContextSafeHandle.Grpc.Core.Internal.IOpCompletionCallback.OnComplete(bool success)	Unknown	No symbols loaded.
Grpc.Core.dll!Grpc.Core.Internal.GrpcThreadPool.RunCompletionQueueEventCallback(Grpc.Core.Internal.IOpCompletionCallback callback, bool success)	Unknown	No symbols loaded.
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)
mscorlib.dll!System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
mscorlib.dll!System.Threading.ThreadPoolWorkQueue.Dispatch()

Looking at the code involved, the exception is being caught - it's not clear whether there's some way to avoid it being shown in the IDE output window.

@jtattermusch jtattermusch self-assigned this Dec 13, 2017
@jtattermusch
Copy link
Contributor

Also see #13227

@lock lock bot locked as resolved and limited conversation to collaborators Sep 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants