-
Notifications
You must be signed in to change notification settings - Fork 15
Description
这是一个关于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:
- The process aborts halfway through traversal (returning false)
- Smaller-timestamp messages are discarded as the new traversal time window cannot match them
Proposed Solutions:
- Ensure strict chronological ordering within Chunks during recording (Recommended approach)
- Sort messages within Chunks in RecordReader before processing