Commit Graph

6945 Commits

Author SHA1 Message Date
Marten Seemann
f07d6939d0 congestion: avoid overflows when calculating pacer budget (#5390)
* congestion: prevent uint64 overflow in pacer

This should never happen for bandwidths even remotely possible in
real-world scenarios, but it’s better to be safe.

* congestion: add a benchmark test for the pacer

* add a comment
2025-10-17 07:30:07 +02:00
Marten Seemann
42b198b8d1 use default RTT (100ms) for 0-RTT if no prior estimate (#5388)
* utils: initialize the {Smoothed, Latest, Min}RTT to 100ms

* utils: use time.Duration.Nanoseconds instead of uint64

No functional change expected.

* congestion: better check to avoid division by zero
2025-10-16 09:32:46 +02:00
Marten Seemann
5e5100b40c http3: add the qlog event schema to trace header (#5383) 2025-10-15 06:02:05 +02:00
Marten Seemann
378d867241 http3: qlog reserved, unsupported and unknown frames (#5381) 2025-10-12 14:11:54 +02:00
Marten Seemann
b7d987f5e4 http3: qlog the frame length and payload length of parsed frames (#5380) 2025-10-12 10:58:32 +02:00
Marten Seemann
ce12204bc3 http3: qlog sent and received SETTINGS frames (#5379)
* http3: implement qlog serialization for SETTINGS frames

* http3: qlog sent and received SETTINGS frames
2025-10-12 07:16:37 +02:00
Marten Seemann
cd4b1307db http3: move qlogging of frames into the frame parser (#5378) 2025-10-12 06:40:24 +02:00
Marten Seemann
ed194a0c5e http3: qlog sent and received DATAGRAMs (#5375) 2025-10-11 14:14:06 +02:00
Marten Seemann
f330d0e257 http3: qlog sent and received GOAWAY frames (#5376) 2025-10-11 13:20:01 +02:00
FS
6c4abb9c14 README: update OSS-Fuzz link (#5377)
oss-fuzz issues has been migrated to issues.oss-fuzz.com and the project field is not searcheable.
2025-10-11 11:38:25 +02:00
Marten Seemann
7796175c64 http3: add basic client-side qlog support (#5374) 2025-10-11 10:13:49 +02:00
Marten Seemann
53d246840d http3: fix qlog encoding of frame_parsed and frame_created events (#5372) 2025-10-11 09:48:05 +02:00
Marten Seemann
115e8ee5d7 qlog: use PathEndpointInfo in connection_started (#5368)
* qlog: use PathEndpointInfo in connection_started

* correctly deal with dual-stack addresses
2025-10-11 07:55:38 +02:00
Marten Seemann
ae909aeb72 jsontext: add support for encoding null (#5371) 2025-10-11 07:08:06 +02:00
Marten Seemann
ca05442ab9 http3: add basic server-side qlog support (#5367)
* add Conn.QlogTrace

* http3: add basic qlog support on the server side
2025-10-10 12:35:58 +02:00
Marten Seemann
fb232c81ee ci: include OS and Go version in Codecov test report upload (#5370) 2025-10-10 09:45:25 +02:00
Marten Seemann
fb4188379e fix qlogging of the short header payload length (#5365) 2025-10-09 14:17:55 +02:00
Marten Seemann
8d1b4811c4 qlog: privatize Encode methods of non-Event structs (#5364) 2025-10-09 14:12:19 +02:00
Marten Seemann
03a99447fd ackhandler: fix qlogging of alarm timer expiration time (#5363) 2025-10-09 10:21:06 +02:00
Marten Seemann
e0f9663be4 qlogwriter: pass the event time to Event.Encode (#5362)
This is needed for events such as recovery:loss_timer_updated, which
contain the timer expiration timestamp encoded as a difference from the
event time.
2025-10-09 07:57:14 +02:00
Marten Seemann
c26e86c547 qlogwriter: add support for event_schemas in the trace header (#5361) 2025-10-09 06:07:23 +02:00
Marten Seemann
33af12712e qlogwriter: implement the draft-12 trace header (#5360) 2025-10-08 16:21:35 +02:00
Marten Seemann
c2131eb595 qlog: split serializiation and event definitions, remove logging abstraction (#5356)
* qlog: implement a Trace and a Writer struct

* qlog: rename Trace to FileSeq

* split qlog trace writer and QUIC qlog events into separate packages

* use the new qlog.Recorder instead of the logging.ConnectionTracer
2025-10-08 05:53:02 +02:00
Marten Seemann
c9d3778fe0 use synctest in more connection tests (#5357)
No functional change expected.
2025-10-06 14:49:04 +02:00
Marco Munizaga
73e8240bd3 ci: remove 386 (32 bit x86) (#5352)
The last 386 cpu was from 20 years ago (Pentium 4)
2025-10-06 07:23:09 +02:00
Marten Seemann
e6d5d960e3 qlog: implement a minimal jsontext-like JSON encoder (#5353)
* qlog: use fork of encoding/json/jsontext instead of unmaintained gojay

* implement a minimal jsontext-compatible encoder

* qlogtext: improve fuzz test

* qlog: simplify JSON encoding error handling

* qlog: make use of jsontext.Bool
2025-10-06 06:48:40 +02:00
Marten Seemann
7c1ce0efe2 ackhandler: track lost packets and detect spurious losses (#5355)
* ackhandler: implement a lost packet tracker

* logging: add ConnectionTracer.DetectedSpuriousLoss event

* ackhandler: detect spurious losses

* qlog: add support for logging spurious packet loss

* ackhandler: delete lost packets after detecting spurios loss

* guard against slice index underflow
v0.55.0
2025-10-03 09:59:50 +02:00
Marten Seemann
0f5d99db94 fix missing tracing of restored transport parameters (#5349) 2025-10-03 08:53:20 +02:00
Marten Seemann
f607ef489f protocol: optimize ConnectionID.String (#5351)
This function is used by qlog, so it should be fast.
2025-10-03 14:27:39 +08:00
Marten Seemann
ce7c9ea883 drop initial keys when the handshake is confirmed (#5354) 2025-10-03 07:25:05 +02:00
Marten Seemann
97f3aae776 use synctest to make the connection tests fully deterministic (#5317) 2025-09-24 12:54:22 +02:00
Marten Seemann
2ac3b16df4 improve connection timer logic (#5339)
* simplify timer resets

As of Go 1.23, timer resets work as expected, and there’s no need to
read a (potentially) stale value from the timer channel.

* don't save the last time

* track if blocked

* remove unblock after sendingScheduled

* fix unblock logic when sending

* don't use fallthrough

* track the blocking mode

* remove stale comment
2025-09-24 10:43:01 +02:00
Marten Seemann
44869e6823 add a benchmark test for data transfers (#5335) 2025-09-20 12:23:50 +02:00
Marten Seemann
adc13be540 implement a memory-optimized time.Time replacement (#5334)
* implement a memory-optimized time.Time replacement

* monotime: properly handle systems with bad timer resolution (Windows)

* monotime: simplify Since
2025-09-14 08:12:10 +02:00
Marten Seemann
f61188b8ff ackhandler: add a benchmark for sending and acknowledging packets (#5333)
* ackhandler: add a benchmark for sending and acknowledging packets

* report allocs, improve benchmark names
2025-09-14 07:00:13 +02:00
Marcin Rataj
efe74cdbf1 return stream frames to pool on stream cancellations (#5327)
* fix: return stream frames to pool on error paths

fixes potential memory leak where StreamFrames were not returned to
sync.Pool in error/cancellation paths.

root cause: frames are llocated via GetStreamFrame() but never returned
via PutBack() when streams enter terminal states without going through
normal OnAcked() cleanup.

fixed paths:
- CancelWrite(): return frames when reliableOffset == 0
- handleStopSendingFrame(): return frames on STOP_SENDING
- closeForShutdown(): return frames on connection shutdown
- OnLost(): return frame when stream reset with no data sent

* fix: clear slice before nil assignment, remove excessive tests

- add clear() call to properly release GC references per https://github.com/quic-go/quic-go/pull/5327#discussion_r2328451862
- remove excessive pool return tests per https://github.com/quic-go/quic-go/pull/5327#discussion_r2328453227
2025-09-09 13:15:45 +02:00
dependabot[bot]
075f701ccb ci: bump actions/setup-go from 5 to 6 (#5330)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5 to 6.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-08 06:52:38 +02:00
Glonee
0ae8c03816 http3: don't allow usage of closed Transport (#5324)
* do not allow use a closed transport

* update tests

* add test

* Update http3/transport.go

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

* unit tests

* update test

---------

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2025-09-07 12:52:25 +02:00
Marten Seemann
6dcac15a12 qlog: merge event category and name (#5329)
This follows a (not so recent) change to the qlog specification.
2025-09-07 11:40:45 +02:00
Marten Seemann
2dfd4dd6bf qlog: add a benchmark for the ConnectionTracer (#5328)
This test aims to benchmark a somewhat realistic scenario of a QUIC
connection that sends packets and receives acknowledgments.
2025-09-07 11:16:26 +02:00
Glonee
483d257336 http3: fix race in concurrent Transport.RoundTrip calls (#5323)
* http3: fix data race in Transport

* reset init Once
2025-09-07 05:25:00 +02:00
Marten Seemann
357f679072 ackhandler: store the last four skipped packets (#5322)
This allows for more accurate packet number difference calculations,
which is especially important once we attempt to detect spurious loss
detection events.
2025-08-30 08:05:59 +02:00
Marten Seemann
0bef51ec76 ackhandler: account for skipped packets in packet threshold calculation (#5316) 2025-08-29 05:39:41 +02:00
Marten Seemann
9cd98f48bf ackhandler: store skipped packet numbers separately (#5314) 2025-08-29 05:09:46 +02:00
Marten Seemann
5bb2146b47 ackhandler: avoid storing packet number in packet struct (#5312)
* ackhandler: optimize memory layout of packet struct

The packet number can be derived from the position that this packet is
stored at in the packets slice in the sent packet history. There is no
need to store the packet number, saving 8 bytes per packet.

* ackhandler: avoid copying the packet struct
2025-08-29 04:18:45 +02:00
Marten Seemann
13a9a650f2 ci: fix cache paths in cross compile workflow (#5318) 2025-08-29 04:05:44 +02:00
Marten Seemann
b6119744e4 ci: improve cache key generation for the cross compilation job (#5315) 2025-08-28 17:12:06 +02:00
Marten Seemann
c8e7cd66e3 ackhandler: immediately clear ackedPacket slice after processing ACK (#5313)
* ackhandler: immediately clear ackedPacket slice after processing ACK

* ackhandler: add defensive check for empty ackedPackets slice
2025-08-28 16:12:20 +02:00
Marten Seemann
168889f283 ackhandler: use a typed mock for the ECNHandler (#5311)
No functional change expected.
2025-08-28 13:39:42 +02:00
Marten Seemann
0cd4bd940b ackhandler: use an iterator to process received packet ranges (#5309)
* ackhandler: use an interator to track received packet ranges

* use slices.Collect

* naming convention
2025-08-28 10:32:26 +02:00