code: func (dwpt *DocumentsWriterPerThread) abort(createdFiles map[string]bool) {
  	assert(createdFiles != nil)
  	log.Printf("now abort seg=%v", dwpt.segmentInfo.Name)
  	dwpt.hasAborted, dwpt.aborting = true, true
  	defer func() {
  		dwpt.aborting = false
  		if dwpt.infoStream.IsEnabled("DWPT") {
  			dwpt.infoStream.Message("DWPT", "done abort")
  		}
  	}()
  
  	if dwpt.infoStream.IsEnabled("DWPT") {
  		dwpt.infoStream.Message("DWPT", "now abort")
  	}
  	dwpt.consumer.abort()
  
  	dwpt.pendingUpdates.clear()
  	dwpt.directory.EachCreatedFiles(func(file string) {
  		createdFiles[file] = 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.
  */