|  | @@ -44,8 +44,6 @@ namespace Grpc.Core
 | 
	
		
			
				|  |  |          readonly ChannelSafeHandle handle;
 | 
	
		
			
				|  |  |          readonly Dictionary<string, ChannelOption> options;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        readonly Task connectivityWatcherTask;
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |          bool shutdownRequested;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          /// <summary>
 | 
	
	
		
			
				|  | @@ -86,9 +84,6 @@ namespace Grpc.Core
 | 
	
		
			
				|  |  |                      this.handle = ChannelSafeHandle.CreateInsecure(target, nativeChannelArgs);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  | -            // TODO(jtattermusch): Workaround for https://github.com/GoogleCloudPlatform/google-cloud-dotnet/issues/822.
 | 
	
		
			
				|  |  | -            // Remove once retries are supported in C core
 | 
	
		
			
				|  |  | -            this.connectivityWatcherTask = RunConnectivityWatcherAsync();
 | 
	
		
			
				|  |  |              GrpcEnvironment.RegisterChannel(this);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -250,7 +245,7 @@ namespace Grpc.Core
 | 
	
		
			
				|  |  |                  handle.Dispose();
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -            await Task.WhenAll(GrpcEnvironment.ReleaseAsync(), connectivityWatcherTask).ConfigureAwait(false);
 | 
	
		
			
				|  |  | +            await GrpcEnvironment.ReleaseAsync().ConfigureAwait(false);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          internal ChannelSafeHandle Handle
 | 
	
	
		
			
				|  | @@ -308,34 +303,6 @@ namespace Grpc.Core
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        /// <summary>
 | 
	
		
			
				|  |  | -        /// Constantly Watches channel connectivity status to work around https://github.com/GoogleCloudPlatform/google-cloud-dotnet/issues/822
 | 
	
		
			
				|  |  | -        /// </summary>
 | 
	
		
			
				|  |  | -        private async Task RunConnectivityWatcherAsync()
 | 
	
		
			
				|  |  | -        {
 | 
	
		
			
				|  |  | -            try
 | 
	
		
			
				|  |  | -            {
 | 
	
		
			
				|  |  | -                var lastState = State;
 | 
	
		
			
				|  |  | -                while (lastState != ChannelState.Shutdown)
 | 
	
		
			
				|  |  | -                {
 | 
	
		
			
				|  |  | -                    lock (myLock)
 | 
	
		
			
				|  |  | -                    {
 | 
	
		
			
				|  |  | -                        if (shutdownRequested)
 | 
	
		
			
				|  |  | -                        {
 | 
	
		
			
				|  |  | -                            break;
 | 
	
		
			
				|  |  | -                        }
 | 
	
		
			
				|  |  | -                    }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -                    // ignore the result
 | 
	
		
			
				|  |  | -                    await WaitForStateChangedInternalAsync(lastState, DateTime.UtcNow.AddSeconds(1)).ConfigureAwait(false);
 | 
	
		
			
				|  |  | -                    lastState = State;
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -            catch (ObjectDisposedException) {
 | 
	
		
			
				|  |  | -                // during shutdown, channel is going to be disposed.
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |          private static void EnsureUserAgentChannelOption(Dictionary<string, ChannelOption> options)
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  |              var key = ChannelOptions.PrimaryUserAgentString;
 |