Skip to content

Recorder play corner case #49

@DieYoungWsn

Description

@DieYoungWsn

这是一个关于cyber_recorder的corner case反馈,具体如下:
因为录制的Chunk中消息的时间并没有严格的有序,播放若干个时间序列不连续的包时,由于RecordViewer的1s步长与最早开始的时间计算出来的时间区间并不能完全覆盖后面包的一整个Chunk,最终会导致Chunk遍历一半的时候return false(假设Chunk内部有大的时间戳消息排在小时间戳消息前面),这就会导致新的遍历时间区间不能去匹配小时间戳消息而被丢掉。
解决这样的问题有两种方式,第一种是在录制的时候在Chunk内保证严格有序,第二种是在RecordReader去读消息前对Chunk消息排序。 个人更推荐第一种。

Corner Case Feedback for cyber_recorder:
When playing back packets with discontinuous time sequences from recorded Chunks, the RecordViewer's 1-second step size combined with the earliest start time may fail to cover an entire subsequent Chunk. This occurs because the calculated time interval cannot fully encompass a Chunk where messages with larger timestamps precede those with smaller timestamps. Consequently, during traversal:

  1. The process aborts halfway through traversal (returning false)
  2. Smaller-timestamp messages are discarded as the new traversal time window cannot match them

Proposed Solutions:

  1. Ensure strict chronological ordering within Chunks during recording (Recommended approach)
  2. Sort messages within Chunks in RecordReader before processing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions