Skip to content

Commit

Permalink
Merge branch 'main' into fix-no-large-rtt-guesses
Browse files Browse the repository at this point in the history
  • Loading branch information
larseggert authored Sep 17, 2024
2 parents df225a0 + 0cb89a9 commit 6de4d70
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 39 deletions.
24 changes: 24 additions & 0 deletions .github/actions/nss/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,29 @@ runs:
echo "System NSS is suitable: $NSS_VERSION"
echo "BUILD_NSS=0" >> "$GITHUB_ENV"
- name: Use sccache
# Apparently the action can't be installed twice in the same workflow, so check if
# it's already installed by checking if the RUSTC_WRAPPER environment variable is set
# (which every "use" of this action needs to therefore set)
if: env.RUSTC_WRAPPER != 'sccache'
uses: mozilla-actions/sccache-action@2e7f9ec7921547d4b46598398ca573513895d0bd # v0.0.4

- name: Enable sscache
shell: bash
run: |
if [ "${{ runner.os }}" != "Windows" ]; then
# TODO: Figure out how to make this work on Windows
echo "SCCACHE_CC=sccache cc" >> "$GITHUB_ENV"
echo "SCCACHE_CXX=sccache c++" >> "$GITHUB_ENV"
fi
echo "CMAKE_C_COMPILER_LAUNCHER=sccache" >> "$GITHUB_ENV"
echo "CMAKE_CXX_COMPILER_LAUNCHER=sccache" >> "$GITHUB_ENV"
if [ "$GITHUB_WORKFLOW" ]; then
echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV"
fi
echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV"
echo "CARGO_INCREMENTAL=0" >> "$GITHUB_ENV"
- name: Checkout NSS
if: env.BUILD_NSS == '1'
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand Down Expand Up @@ -138,6 +161,7 @@ runs:
echo "DYLD_FALLBACK_LIBRARY_PATH=$NSS_OUT/lib" >> "$GITHUB_ENV"
echo "$NSS_OUT/lib" >> "$GITHUB_PATH"
echo "NSS_DIR=$NSS_DIR" >> "$GITHUB_ENV"
[ "$SCCACHE_CC" ] && [ "$SCCACHE_CXX" ] && export CC="$SCCACHE_CC" CXX="$SCCACHE_CXX"
$NSS_DIR/build.sh -g -Ddisable_tests=1 $OPT --static
env:
NSS_DIR: ${{ github.workspace }}/nss
Expand Down
43 changes: 18 additions & 25 deletions .github/actions/rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,24 @@ runs:
components: ${{ inputs.components }}
targets: ${{ inputs.targets }}

- name: Use sccache
# Apparently the action can't be installed twice in the same workflow, so check if
# it's already installed by checking if the RUSTC_WRAPPER environment variable is set
# (which every "use" of this action needs to therefore set)
if: env.RUSTC_WRAPPER != 'sccache'
uses: mozilla-actions/sccache-action@2e7f9ec7921547d4b46598398ca573513895d0bd # v0.0.4

- name: Enable sscache
shell: bash
run: |
echo "CMAKE_C_COMPILER_LAUNCHER=sccache" >> "$GITHUB_ENV"
echo "CMAKE_CXX_COMPILER_LAUNCHER=sccache" >> "$GITHUB_ENV"
if [ "$GITHUB_WORKFLOW" ]; then
echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV"
fi
echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV"
echo "CARGO_INCREMENTAL=0" >> "$GITHUB_ENV"
- name: Set up MSVC (Windows)
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
Expand All @@ -58,28 +76,3 @@ runs:
env:
GITHUB_TOKEN: ${{ inputs.token }}
run: cargo +${{ inputs.version }} quickinstall $(echo ${{ inputs.tools }} | tr -d ",")

# sccache slows CI down, so we leave it disabled.
# Leaving the steps below commented out, so we can re-evaluate enabling it later.
# - name: Use sccache
# uses: mozilla-actions/sccache-action@2e7f9ec7921547d4b46598398ca573513895d0bd # v0.0.4

# - name: Enable sscache
# shell: bash
# run: |
# if [ "${{ runner.os }}" = "Windows" ]; then
# echo "CC=sccache cl" >> "$GITHUB_ENV"
# echo "CXX=sccache cl" >> "$GITHUB_ENV"
# else
# echo "CC=sccache cc" >> "$GITHUB_ENV"
# echo "CXX=sccache c++" >> "$GITHUB_ENV"
# fi
# echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV"
# echo "RUSTC_WRAPPER=sccache" >> "$GITHUB_ENV"
# echo "CARGO_INCREMENTAL=0" >> "$GITHUB_ENV"

# Ditto for rust-cache.
# - name: Use Rust cache
# uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
# with:
# cache-all-crates: "true"
2 changes: 1 addition & 1 deletion .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
CARGO_PROFILE_RELEASE_DEBUG: true
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
TOOLCHAIN: nightly-2024-09-01
TOOLCHAIN: nightly
RUSTFLAGS: -C link-arg=-fuse-ld=lld -C link-arg=-Wl,--no-rosegment, -C force-frame-pointers=yes
PERF_OPT: record -F997 --call-graph fp -g

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
# Don't increase beyond what Firefox is currently using:
# https://searchfox.org/mozilla-central/search?q=MINIMUM_RUST_VERSION&path=python/mozboot/mozboot/util.py
# Keep in sync with Cargo.toml
rust-toolchain: [1.76.0, stable, nightly-2024-09-01]
rust-toolchain: [1.76.0, stable, nightly]
type: [debug]
include:
- os: ubuntu-latest
Expand Down
15 changes: 13 additions & 2 deletions neqo-bin/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,15 +245,26 @@ impl Args {
"handshake" | "transfer" | "retry" | "ecn" => {
self.shared.use_old_http = true;
}
"zerortt" | "resumption" => {
"resumption" => {
if self.urls.len() < 2 {
qerror!("Warning: resumption tests won't work without >1 URL");
qerror!("Warning: resumption test won't work without >1 URL");
exit(127);
}
self.shared.use_old_http = true;
self.resume = true;
}
"zerortt" => {
if self.urls.len() < 2 {
qerror!("Warning: zerortt test won't work without >1 URL");
exit(127);
}
self.shared.use_old_http = true;
self.resume = true;
// PMTUD probes inflate what we sent in 1-RTT, causing QNS to fail the test.
self.shared.quic_parameters.no_pmtud = true;
// If we pace, we might get the initial server flight before sending sufficient
// 0-RTT data to pass the QNS check. So let's burst.
self.shared.quic_parameters.no_pacing = true;
}
"multiconnect" => {
self.shared.use_old_http = true;
Expand Down
2 changes: 1 addition & 1 deletion neqo-http3/src/connection_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4351,7 +4351,7 @@ mod tests {
assert_eq!(*server.conn.state(), State::Init);
let out = server.conn.process(out.as_dgram_ref(), now());

// Check that control and qpack streams anda SETTINGS frame are received.
// Check that control and qpack streams and a SETTINGS frame are received.
// Also qpack encoder stream will send "change capacity" instruction because it has
// the peer settings already.
server.check_control_qpack_request_streams_resumption(
Expand Down
2 changes: 1 addition & 1 deletion neqo-qpack/src/decoder_instructions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl DecoderInstructionReader {
/// 2) `ClosedCriticalStream`
/// 3) other errors will be translated to `DecoderStream` by the caller of this function.
pub fn read_instructions<R: ReadByte>(&mut self, recv: &mut R) -> Res<DecoderInstruction> {
qdebug!([self], "read a new instraction");
qdebug!([self], "read a new instruction");
loop {
match &mut self.state {
DecoderInstructionReaderState::ReadInstruction => {
Expand Down
2 changes: 1 addition & 1 deletion neqo-qpack/src/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl QPackEncoder {
}

fn read_instructions(&mut self, conn: &mut Connection, stream_id: StreamId) -> Res<()> {
qdebug!([self], "read a new instraction");
qdebug!([self], "read a new instruction");
loop {
let mut recv = ReceiverConnWrapper::new(conn, stream_id);
match self.instruction_reader.read_instructions(&mut recv) {
Expand Down
9 changes: 2 additions & 7 deletions neqo-transport/src/recovery/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,6 @@ impl LossRecoverySpace {
}
}

#[must_use]
pub const fn space(&self) -> PacketNumberSpace {
self.space
}

/// Find the time we sent the first packet that is lower than the
/// largest acknowledged and that isn't yet declared lost.
/// Use the value we prepared earlier in `detect_lost_packets`.
Expand Down Expand Up @@ -871,14 +866,14 @@ impl LossRecovery {
let pto = Self::pto_period_inner(
primary_path.borrow().rtt(),
self.pto_state.as_ref(),
space.space(),
space.space,
self.fast_pto,
);
space.detect_lost_packets(now, loss_delay, pto, &mut lost_packets);

primary_path.borrow_mut().on_packets_lost(
space.largest_acked_sent_time,
space.space(),
space.space,
&lost_packets[first..],
&mut self.stats.borrow_mut(),
now,
Expand Down

0 comments on commit 6de4d70

Please sign in to comment.