fix(quic): exclude locally rejected datagrams [CI]
ci/woodpecker/push/web-build Pipeline was successful
ci/woodpecker/push/verify Pipeline was successful
ci/woodpecker/push/dev-image Pipeline was canceled

This commit is contained in:
justme committed 2026-10-11 19:58:36 +08:00
1 parent f6e477fb10
commit e82b165eb0
7 files changed
+131 -17

No files matched your search

@@ -1,5 +1,6 @@
using System.Diagnostics;
using System.Net;
using Fleet.Core;
using MoShiro.Protocol;
namespace MoShiro.Measurement;
@@ -121,7 +122,13 @@ public sealed class TrainListener : BlockBase
{
long sendUs = Env.Clock.NowUs();
MeasurementDatagram.Write(packet, new MeasurementDatagramHeader(MeasurementDatagramType.Data, session.SessionId, Spec.StreamId, seq, sendUs), session.Key);
Env.Datagrams!.Send(session, target, packet);
if (!Env.Datagrams!.Send(session, target, packet))
{
Env.Log.Warn("QUIC train datagram was not queued; stopping the train without counting it as loss",
("stream", Spec.StreamId), ("seq", seq), ("bytes", size));
return;
}
Span<long> row = [size, sendUs];
_records.SetRow(seq, row);
Interlocked.Exchange(ref _sent, seq + 1L);
@@ -171,7 +178,10 @@ public sealed class TrainDialer : BlockBase
for (uint seq = 0; seq < 3; seq++)
{
MeasurementDatagram.Write(hello, new MeasurementDatagramHeader(MeasurementDatagramType.Data, session.SessionId, Spec.StreamId, seq, Env.Clock.NowUs()), session.Key);
datagrams.Send(session, target, hello);
if (!datagrams.Send(session, target, hello))
{
throw new BlockFaultException($"QUIC datagram send failed during path discovery (seq {seq}).");
}
}
await WaitUntilCancelledAsync(ct);