Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use try_send, so the caller can handle the IO error #2237

Merged
merged 2 commits into from
Nov 19, 2024

Conversation

KershawChang
Copy link
Collaborator

Fix #2236

Copy link

codecov bot commented Nov 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.37%. Comparing base (7a25525) to head (66307ea).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2237   +/-   ##
=======================================
  Coverage   95.37%   95.37%           
=======================================
  Files         112      112           
  Lines       36570    36570           
=======================================
  Hits        34880    34880           
  Misses       1690     1690           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Copy link
Collaborator

@mxinden mxinden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the catch and patch!

For completeness sake, try_send API was introduced recently in quinn-rs/quinn#2017.

Also for the record, corresponding NSPR implementation:

https://searchfox.org/mozilla-central/rev/b477cd37e845005dac8881427fa06a2771d993db/netwerk/base/nsUDPSocket.cpp#1180-1185

Copy link
Collaborator

@larseggert larseggert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think some tests also use send; should we change those as well?

Copy link

github-actions bot commented Nov 18, 2024

Failed Interop Tests

QUIC Interop Runner, client vs. server

neqo-latest as client

neqo-latest as server

All results

Succeeded Interop Tests

QUIC Interop Runner, client vs. server

neqo-latest as client

neqo-latest as server

Unsupported Interop Tests

QUIC Interop Runner, client vs. server

neqo-latest as client

neqo-latest as server

@mxinden
Copy link
Collaborator

mxinden commented Nov 18, 2024

I think some tests also use send; should we change those as well?

Sounds good. @KershawChang would you mind changing the line below to use try_send as well?

sender.state.send((&sender.inner).into(), &transmit)?;

Copy link

github-actions bot commented Nov 18, 2024

Benchmark results

Performance differences relative to 7a25525.

coalesce_acked_from_zero 1+1 entries: No change in performance detected.
       time:   [91.254 ns 91.555 ns 91.865 ns]
       change: [-0.2752% +0.2772% +0.9959%] (p = 0.42 > 0.05)

Found 10 outliers among 100 measurements (10.00%)
8 (8.00%) high mild
2 (2.00%) high severe

coalesce_acked_from_zero 3+1 entries: Change within noise threshold.
       time:   [101.55 ns 101.78 ns 102.03 ns]
       change: [+0.2749% +0.6689% +1.1021%] (p = 0.00 < 0.05)

Found 10 outliers among 100 measurements (10.00%)
3 (3.00%) low mild
7 (7.00%) high severe

coalesce_acked_from_zero 10+1 entries: Change within noise threshold.
       time:   [100.98 ns 101.46 ns 102.10 ns]
       change: [+0.2790% +0.6578% +1.0500%] (p = 0.00 < 0.05)

Found 5 outliers among 100 measurements (5.00%)
1 (1.00%) low mild
4 (4.00%) high severe

coalesce_acked_from_zero 1000+1 entries: No change in performance detected.
       time:   [82.081 ns 82.259 ns 82.484 ns]
       change: [-1.3425% -0.2026% +1.0582%] (p = 0.75 > 0.05)

Found 7 outliers among 100 measurements (7.00%)
2 (2.00%) high mild
5 (5.00%) high severe

RxStreamOrderer::inbound_frame(): No change in performance detected.
       time:   [111.76 ms 111.89 ms 112.11 ms]
       change: [-0.2233% +0.0236% +0.2392%] (p = 0.87 > 0.05)

Found 4 outliers among 100 measurements (4.00%)
3 (3.00%) low mild
1 (1.00%) high severe

transfer/pacing-false/varying-seeds: No change in performance detected.
       time:   [28.329 ms 29.378 ms 30.442 ms]
       change: [-0.2445% +4.6604% +9.8562%] (p = 0.08 > 0.05)

Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild

transfer/pacing-true/varying-seeds: No change in performance detected.
       time:   [35.862 ms 37.652 ms 39.452 ms]
       change: [-1.8637% +5.2343% +12.853%] (p = 0.15 > 0.05)

Found 3 outliers among 100 measurements (3.00%)
1 (1.00%) low mild
2 (2.00%) high mild

transfer/pacing-false/same-seed: No change in performance detected.
       time:   [27.215 ms 28.107 ms 29.024 ms]
       change: [-1.1097% +3.4116% +7.9328%] (p = 0.14 > 0.05)
transfer/pacing-true/same-seed: No change in performance detected.
       time:   [41.434 ms 43.318 ms 45.252 ms]
       change: [-5.1461% +1.1724% +8.1434%] (p = 0.73 > 0.05)
1-conn/1-100mb-resp/mtu-1504 (aka. Download)/client: 💚 Performance has improved.
       time:   [895.97 ms 905.42 ms 914.98 ms]
       thrpt:  [109.29 MiB/s 110.45 MiB/s 111.61 MiB/s]
change:
       time:   [-5.7514% -4.3547% -3.0137%] (p = 0.00 < 0.05)
       thrpt:  [+3.1074% +4.5529% +6.1024%]
1-conn/10_000-parallel-1b-resp/mtu-1504 (aka. RPS)/client: Change within noise threshold.
       time:   [318.64 ms 321.74 ms 324.91 ms]
       thrpt:  [30.778 Kelem/s 31.081 Kelem/s 31.383 Kelem/s]
change:
       time:   [-2.7556% -1.4948% -0.2351%] (p = 0.03 < 0.05)
       thrpt:  [+0.2356% +1.5174% +2.8337%]
1-conn/1-1b-resp/mtu-1504 (aka. HPS)/client: No change in performance detected.
       time:   [33.890 ms 34.083 ms 34.294 ms]
       thrpt:  [29.160  elem/s 29.340  elem/s 29.507  elem/s]
change:
       time:   [-0.0109% +0.8181% +1.5632%] (p = 0.05 > 0.05)
       thrpt:  [-1.5391% -0.8114% +0.0109%]

Found 5 outliers among 100 measurements (5.00%)
2 (2.00%) high mild
3 (3.00%) high severe

1-conn/1-100mb-resp/mtu-1504 (aka. Upload)/client: No change in performance detected.
       time:   [1.6500 s 1.6725 s 1.6964 s]
       thrpt:  [58.949 MiB/s 59.791 MiB/s 60.605 MiB/s]
change:
       time:   [-1.8257% -0.0406% +1.8793%] (p = 0.96 > 0.05)
       thrpt:  [-1.8447% +0.0407% +1.8596%]

Found 5 outliers among 100 measurements (5.00%)
5 (5.00%) high mild

Client/server transfer results

Transfer of 33554432 bytes over loopback.

Client Server CC Pacing MTU Mean [ms] Min [ms] Max [ms]
gquiche gquiche 1504 543.8 ± 37.6 508.6 598.6
neqo gquiche reno on 1504 763.8 ± 35.5 727.2 834.6
neqo gquiche reno 1504 780.7 ± 67.7 735.9 959.2
neqo gquiche cubic on 1504 791.9 ± 81.3 741.6 1016.3
neqo gquiche cubic 1504 755.1 ± 14.2 730.0 775.5
msquic msquic 1504 166.0 ± 95.8 99.4 366.4
neqo msquic reno on 1504 213.3 ± 12.4 199.4 232.7
neqo msquic reno 1504 212.0 ± 11.9 196.2 230.7
neqo msquic cubic on 1504 227.2 ± 15.8 204.6 256.1
neqo msquic cubic 1504 218.9 ± 13.6 199.7 248.4
gquiche neqo reno on 1504 764.9 ± 82.1 656.1 881.3
gquiche neqo reno 1504 723.3 ± 95.4 595.2 868.3
gquiche neqo cubic on 1504 770.4 ± 93.2 623.9 891.4
gquiche neqo cubic 1504 771.8 ± 154.6 607.9 1134.0
msquic neqo reno on 1504 744.3 ± 37.6 707.8 821.1
msquic neqo reno 1504 714.2 ± 11.3 690.1 728.0
msquic neqo cubic on 1504 744.4 ± 55.0 714.5 897.4
msquic neqo cubic 1504 720.9 ± 47.8 664.8 820.5
neqo neqo reno on 1504 669.3 ± 24.5 645.3 715.9
neqo neqo reno 1504 669.8 ± 24.7 647.9 717.6
neqo neqo cubic on 1504 639.3 ± 43.6 615.1 752.2
neqo neqo cubic 1504 657.7 ± 83.5 610.0 815.5

⬇️ Download logs

@mxinden
Copy link
Collaborator

mxinden commented Nov 18, 2024

@KershawChang we don't currently propagate the concrete IO error, but instead a generic error (i.e. NS_ERROR_FAILURE) only.

https://searchfox.org/mozilla-central/rev/b477cd37e845005dac8881427fa06a2771d993db/netwerk/socket/neqo_glue/src/lib.rs#764-777

Should we convert the concrete IO errors into their corresponding NS_* errors in neqo_glue/src/lib.rs? I am happy to provide a patch.

@KershawChang
Copy link
Collaborator Author

I think some tests also use send; should we change those as well?

Sounds good. @KershawChang would you mind changing the line below to use try_send as well?

sender.state.send((&sender.inner).into(), &transmit)?;

Will do.

@KershawChang
Copy link
Collaborator Author

@KershawChang we don't currently propagate the concrete IO error, but instead a generic error (i.e. NS_ERROR_FAILURE) only.

https://searchfox.org/mozilla-central/rev/b477cd37e845005dac8881427fa06a2771d993db/netwerk/socket/neqo_glue/src/lib.rs#764-777

Should we convert the concrete IO errors into their corresponding NS_* errors in neqo_glue/src/lib.rs? I am happy to provide a patch.

Yes, I think we should. Once this PR merged and a new neqo released, we should prepare a patch for NS_* errors.
Thanks.

@larseggert larseggert added this pull request to the merge queue Nov 19, 2024
Merged via the queue into mozilla:main with commit c6b518c Nov 19, 2024
61 of 62 checks passed
@mxinden
Copy link
Collaborator

mxinden commented Nov 19, 2024

@KershawChang we don't currently propagate the concrete IO error, but instead a generic error (i.e. NS_ERROR_FAILURE) only.
https://searchfox.org/mozilla-central/rev/b477cd37e845005dac8881427fa06a2771d993db/netwerk/socket/neqo_glue/src/lib.rs#764-777
Should we convert the concrete IO errors into their corresponding NS_* errors in neqo_glue/src/lib.rs? I am happy to provide a patch.

Yes, I think we should. Once this PR merged and a new neqo released, we should prepare a patch for NS_* errors. Thanks.

👍 I will prepare a new Neqo release and look into the relevant changes in mozilla-central to map the errors.

@mxinden mxinden mentioned this pull request Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

send() returns Ok(()) on IO errors
3 participants