File tree Expand file tree Collapse file tree 1 file changed +1
-7
lines changed
src/MongoDB.Driver.Core/Core/Connections Expand file tree Collapse file tree 1 file changed +1
-7
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,6 @@ internal class BinaryConnection : IConnection
5050 private readonly Dropbox _dropbox = new Dropbox ( ) ;
5151 private DateTime _lastUsedAtUtc ;
5252 private DateTime _openedAtUtc ;
53- private Exception _openException ;
5453 private readonly object _openLock = new object ( ) ;
5554 private Task _openTask ;
5655 private readonly SemaphoreSlim _receiveLock ;
@@ -220,6 +219,7 @@ public void Open(CancellationToken cancellationToken)
220219 _openedAtUtc = DateTime . UtcNow ;
221220 taskCompletionSource = new TaskCompletionSource < bool > ( ) ;
222221 _openTask = taskCompletionSource . Task ;
222+ _openTask . IgnoreExceptions ( ) ;
223223 connecting = true ;
224224 }
225225 }
@@ -234,12 +234,6 @@ public void Open(CancellationToken cancellationToken)
234234 catch ( Exception ex )
235235 {
236236 taskCompletionSource . TrySetException ( ex ) ;
237-
238- // this line is here to ensure we treat this exception
239- // as observed and prevent the TaskScheduler.UnobservedException
240- // event from getting raised.
241- _openException = taskCompletionSource . Task . Exception ;
242-
243237 throw ;
244238 }
245239 }
You can’t perform that action at this time.
0 commit comments