code: @Override
      public List<PendingEvent> getUnackedEventsOnSeal() {
          // close connection and update the exception to SegmentSealed, this ensures future writes receive a
          // SegmentSealedException.
          log.debug("GetUnackedEventsOnSeal called on {}", writerId);
          synchronized (writeOrderLock) {   
              state.failConnection(new SegmentSealedException(this.segmentName));
              return Collections.unmodifiableList(state.getAllInflightEvents());
          }
      }
docs: This function is invoked by SegmentSealedCallback, i.e., when SegmentSealedCallback or getUnackedEventsOnSeal()
  is invoked there are no writes happening to the Segment.
  @see SegmentOutputStream#getUnackedEventsOnSeal()