Add bytes cap on migration data cache size (#4782)

This commit is contained in:
cnderrauber
2026-08-21 16:49:09 +08:00
committed by GitHub
parent 6a64df20df
commit 803864dc7b
3 changed files with 40 additions and 9 deletions
+3 -1
View File
@@ -2447,7 +2447,7 @@ func (p *ParticipantImpl) onReceivedDataMessage(kind livekit.DataPacket_Kind, da
}
if migrationCache := p.reliableDataInfo.migrateInPubDataCache.Load(); migrationCache != nil {
switch migrationCache.Add(dp) {
switch migrationCache.Add(dp, len(data)) {
case MigrationDataCacheStateWaiting:
// waiting for the reliable sequence to continue from last node
return
@@ -2466,6 +2466,8 @@ func (p *ParticipantImpl) onReceivedDataMessage(kind livekit.DataPacket_Kind, da
"migration data cache timed out, handling cached messages", nil,
"cachedFirstSeq", cachedMsgs[0].Sequence,
"cachedLastSeq", cachedMsgs[len(cachedMsgs)-1].Sequence,
"cachedNum", len(cachedMsgs),
"cachedSize", migrationCache.Size(),
"lastPubReliableSeq", p.params.LastPubReliableSeq,
)
}