code: func (ss *FileSubStore) shrinkBuffer(fromTimer bool) {
  	ss.Lock()
  	defer ss.Unlock()
  
  	if ss.closed {
  		ss.allDone.Done()
  		return
  	}
  	// Fire again
  	if fromTimer {
  		ss.shrinkTimer.Reset(bufShrinkInterval)
  	}
  
  	// If file currently opened, lock it, otherwise we are done for now.
  	if !ss.fm.lockFileIfOpened(ss.file) {
  		return
  	}
  	// If error, the buffer (in bufio) memorizes the error
  	// so any other write/flush on that buffer will fail. We will get the
  	// error at the next "synchronous" operation where we can report back
  	// to the user.
  	ss.writer, _ = ss.bw.tryShrinkBuffer(ss.file.handle)
  	ss.fm.unlockFile(ss.file)
  }
docs: // shrinkBuffer is a timer callback that shrinks the buffer writer when possible.
  // Since this function is called directly in tests, the boolean `fromTimer` is
  // used to indicate if this function is invoked from the timer callback (in which
  // case, the timer need to be Reset()) or not. Reseting a timer while timer fires
  // can lead to unexpected behavior.