public void Dispose() { foreach (var r in _reduceDocuments) { r.Document.Dispose(); } _jsonContext?.Dispose(); }
public void Dispose() { foreach (var docReader in _docs) { docReader.Dispose(); } _ctx.Dispose(); }
public override void Dispose() { foreach (var docReader in _docs) { docReader.Dispose(); } _ctx.Dispose(); base.Dispose(); }
private void DisposeInternal() { try { _disconnect(); // force disconnection, to abort read/write } catch (Exception) { // even if we get an error , we must continue to the actual disposal } using (_disposerLock.StartDisposing()) { RemoteConnectionsList.TryRemove(_info); _stream?.Dispose(); _releaseBuffer?.Dispose(); _context?.Dispose(); } }
public async Task DisposeAsync() { try { try { _documents.CompleteAdding(); await _writeToServerTask.ConfigureAwait(false); //Make sure that if the server goes down //in the last moment, we do not get stuck here. //In general, 1 minute should be more than enough for the //server to finish its stuff and get back to client var timeDelay = Debugger.IsAttached ? TimeSpan.FromMinutes(30) : TimeSpan.FromSeconds(30); while (true) { var timeoutTask = Task.Delay(timeDelay); var res = await Task.WhenAny(timeoutTask, _getServerResponseTask).ConfigureAwait(false); if (timeoutTask != res) { break; } if (SystemTime.UtcNow - _lastHeartbeat > timeDelay + TimeSpan.FromSeconds(60)) { // Waited to much for close msg from server in bulk insert.. can happen in huge bulk insert ratios. throw new TimeoutException("Wait for bulk-insert closing message from server, but it didn't happen. Maybe the server went down (most likely) and maybe this is due to a bug. In any case,this needs to be investigated."); } } } finally { _tcpClient?.Dispose(); } } finally { _tcpClient = null; _jsonOperationContext?.Dispose(); _jsonOperationContext = null; GC.SuppressFinalize(this); } }
public override void Dispose() { _ctx.Dispose(); base.Dispose(); }
public void Dispose() { _allowedPathsContext?.Dispose(); _documentInfoHelper?.Dispose(); }
public void Dispose() { _jsonContext?.Dispose(); }