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
50
50
private readonly Dropbox _dropbox = new Dropbox ( ) ;
51
51
private DateTime _lastUsedAtUtc ;
52
52
private DateTime _openedAtUtc ;
53
- private Exception _openException ;
54
53
private readonly object _openLock = new object ( ) ;
55
54
private Task _openTask ;
56
55
private readonly SemaphoreSlim _receiveLock ;
@@ -220,6 +219,7 @@ public void Open(CancellationToken cancellationToken)
220
219
_openedAtUtc = DateTime . UtcNow ;
221
220
taskCompletionSource = new TaskCompletionSource < bool > ( ) ;
222
221
_openTask = taskCompletionSource . Task ;
222
+ _openTask . IgnoreExceptions ( ) ;
223
223
connecting = true ;
224
224
}
225
225
}
@@ -234,12 +234,6 @@ public void Open(CancellationToken cancellationToken)
234
234
catch ( Exception ex )
235
235
{
236
236
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
-
243
237
throw ;
244
238
}
245
239
}
You can’t perform that action at this time.
0 commit comments