code: func (r *ForwardRecorder) Close() error {
  	var errors []error
  	err := r.AuditLog.Close()
  	errors = append(errors, err)
  
  	// wait until all events from recorder get flushed, it is important
  	// to do so before we send SessionEndEvent to advise the audit log
  	// to release resources associated with this session.
  	// not doing so will not result in memory leak, but could result
  	// in missing playback events
  	context, cancel := context.WithTimeout(context.TODO(), defaults.ReadHeadersTimeout)
  	defer cancel() // releases resources if slowOperation completes before timeout elapses
  	err = r.AuditLog.WaitForDelivery(context)
  	if err != nil {
  		errors = append(errors, err)
  		r.Warnf("Timeout waiting for session to flush events: %v", trace.DebugReport(err))
  	}
  
  	return trace.NewAggregate(errors...)
  }
docs: // Close closes audit log session recorder