code: func (dw *DocumentsWriter) abort(writer *IndexWriter) {
  	dw.Lock()
  	defer dw.Unlock()
  
  	var success = false
  	var newFilesSet = make(map[string]bool)
  	defer func() {
  		if dw.infoStream.IsEnabled("DW") {
  			dw.infoStream.Message("DW", "done abort; abortedFiles=%v success=%v", newFilesSet, success)
  		}
  	}()
  
  	dw.deleteQueue.clear()
  	if dw.infoStream.IsEnabled("DW") {
  		dw.infoStream.Message("DW", "abort")
  	}
  	dw.perThreadPool.foreach(func(perThread *ThreadState) {
  		dw.abortThreadState(perThread, newFilesSet)
  	})
  	dw.flushControl.abortPendingFlushes(newFilesSet)
  	dw.putEvent(newDeleteNewFilesEvent(newFilesSet))
  	dw.flushControl.waitForFlush()
  	success = true
  }
docs: /*
  Called if we hit an error at a bad time (when updating the index
  files) and must discard all currently buffered docs. This resets our
  state, discarding any docs added since last flush.
  */