1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-11-25 15:43:13 +03:00
Commit Graph

393 Commits

Author SHA1 Message Date
Nikita Lutsenko
b4dabd142d clang-format | Format fbsource with clang-format 21.
Reviewed By: ChristianK275

Differential Revision: D85317706

fbshipit-source-id: b399c5c4b75252999442b7d7d2778e7a241b0025
2025-10-26 23:40:59 -07:00
Sandarsh Srivastava
a65d7d46cf Fix use-after-free in QuicTransportBaseLite::DrainTimeout
Summary:
*   Added an explicit destructor to `QuicTransportBaseLite` that is the same as its derived  QuicTransportBase.

*   Simplified `QuicTransportBase` destructor to `= default` since the parent class now handles all cleanup.

Reviewed By: mjoras, jbeshay

Differential Revision: D84391365

fbshipit-source-id: 61034b46283c8e13eec26c473a597337e4868a17
2025-10-13 23:37:53 -07:00
generatedunixname89002005287564
398dbbc0c9 Fix CQS signal facebook-unused-include-check in fbcode/quic/api
Reviewed By: dtolnay

Differential Revision: D78723468

fbshipit-source-id: 5ad35cf4bc8ed3a491851f512f5af44adc059eac
2025-07-23 18:53:28 -07:00
Joseph Beshay
2d8b3b25cf Remove CHECKs for errors that can be survived by connections
Summary: As title. Some of these CHECKs are failing on errors that were ignored before D76488955.

Reviewed By: dddmello

Differential Revision: D78177866

fbshipit-source-id: f828a4e9fe668038e90bd10533b9c10840adf1ca
2025-07-11 18:43:15 -07:00
Matt Joras
4601c4bdae Migrate folly::Expected to quic::Expected
Summary:
This migrates the quic code to use quic::Expected instead of folly::Expected. quic::Expected is a vendored wrapper for expected-lite, which itself matches std::expected. std::expected is not available to us, but once it is, we would be able to further simplify to the std version.

This migration is almost entirely mechanical.
 ---
> Generated by [Confucius Code Assist (CCA)](https://www.internalfb.com/wiki/Confucius/Analect/Shared_Analects/Confucius_Code_Assist_(CCA)/)
[Session](https://www.internalfb.com/confucius?session_id=7044a18e-4d22-11f0-afeb-97de80927172&tab=Chat), [Trace](https://www.internalfb.com/confucius?session_id=7044a18e-4d22-11f0-afeb-97de80927172&tab=Trace)
 ---
> Generated by [RACER](https://www.internalfb.com/wiki/RACER_(Risk-Aware_Code_Editing_and_Refactoring)/), powered by [Confucius](https://www.internalfb.com/wiki/Confucius/Analect/Shared_Analects/Confucius_Code_Assist_(CCA)/)
[Session](https://www.internalfb.com/confucius?session_id=1fea6620-4d30-11f0-a206-ad0241db9ec9&tab=Chat), [Trace](https://www.internalfb.com/confucius?session_id=1fea6620-4d30-11f0-a206-ad0241db9ec9&tab=Trace)
[Session](https://www.internalfb.com/confucius?session_id=2bdbabba-505a-11f0-a21b-fb3d40195e00&tab=Chat), [Trace](https://www.internalfb.com/confucius?session_id=2bdbabba-505a-11f0-a21b-fb3d40195e00&tab=Trace)
[Session](https://www.internalfb.com/confucius?session_id=eb689fd2-5114-11f0-ade8-99c0fe2f80f2&tab=Chat), [Trace](https://www.internalfb.com/confucius?session_id=eb689fd2-5114-11f0-ade8-99c0fe2f80f2&tab=Trace)
[Session](https://www.internalfb.com/confucius?session_id=9bc2dcec-51f8-11f0-8604-7bc1f5225a86&tab=Chat), [Trace](https://www.internalfb.com/confucius?session_id=9bc2dcec-51f8-11f0-8604-7bc1f5225a86&tab=Trace)
[Session](https://www.internalfb.com/confucius?session_id=46b187ea-5cdd-11f0-9bab-7b6b886e8a09&tab=Chat), [Trace](https://www.internalfb.com/confucius?session_id=46b187ea-5cdd-11f0-9bab-7b6b886e8a09&tab=Trace)

Reviewed By: kvtsoy

Differential Revision: D76488955

fbshipit-source-id: 92b9cbeac85a28722a6180464b47d84696b1e81b
2025-07-10 15:57:07 -07:00
Matt Joras
9a9dcca57c Mostly remove folly::Optional
Summary:
This is an API break, but it should mostly be a manageable one. We want to be able to compile mvfst internally without exceptions, and folly::Optional is one dependency that makes this challenging. Additionally, we already have an imported secondary optional type for performance/struct size reasons, tiny-optional.

This second optional interface is mostly compatible in an API sense (including the use of std::nullopt) with std::optional. Thus our approach is to remove the dependency on folly::Optional, and offer a quic::Optional instead.

The next diff will properly vendor tiny-optional so that quic::Optional is an independent version of it.

Reviewed By: sharmafb, kvtsoy

Differential Revision: D74133131

fbshipit-source-id: 715f8bb5043ba3bb876cacfe54236887e0686b30
2025-05-07 23:01:49 -07:00
Konstantin Tsoy
fd8187143a use std::function in base transport
Summary: use std::function in base transport

Reviewed By: mjoras

Differential Revision: D73380174

fbshipit-source-id: 2e51c8bd28c3b7387908cfb04008836f0e6daccf
2025-04-22 20:44:16 -07:00
Konstantin Tsoy
31539debae use std::function in peek()
Summary: use std::function in peek()

Reviewed By: mjoras

Differential Revision: D73371749

fbshipit-source-id: a63e519631164979f3c4c8aee71504b765beffc3
2025-04-22 20:44:16 -07:00
Aman Sharma
41667ff7c5 Change Buf -> BufPtr and RawBuf -> Buf
Summary:
Previously,
* `RawBuf` was a typealias for `std::unique_ptr<folly::IOBuf>`
* `Buf` was a typealias for `folly::IOBuf`

In this diff,
* `Buf` is a typealias for `folly::IOBuf`
* `BufPtr` is a typealias for `std::unique_ptr<folly::IOBuf>`

Reviewed By: hanidamlaj

Differential Revision: D73206576

fbshipit-source-id: 454bf6ccfce3d6571e5e931889263ed98cc24af3
2025-04-21 20:14:02 -07:00
Matt Joras
089bf581a7 Remove throws from socket layer
Summary: More in the theme of returning Expected instead of throwing. For the folly case, we keep the try/catches in there and translate to Expected. For Libev, we convert directly to Expected.

Reviewed By: kvtsoy

Differential Revision: D73217128

fbshipit-source-id: d00a978f24e3b29a77a8ac99a19765ae49f64df8
2025-04-19 15:20:15 -07:00
Alan Frindell
444a0f261b Use new PriorityQueue interface
Summary:
Migrating mvfst priority API to be abstract, based on new classes is quic/priority.  For now, it requires applications use `HTTPPriorityQueue::Priority`, to be compatible with the hardcoded `deprecated::PriorityQueue` implementation and apps cannot yet change the queue impl.  Eventually the application will have full control of the queue.

There are minor functional changes in this diff:

1. Priority QLog types changed from int/bool to string
2. Any PAUSED stream has priority `u=7,i` if paused streams are disabled (previously explicitly settable to any priority)

Reviewed By: jbeshay

Differential Revision: D68696110

fbshipit-source-id: 5a4721b08248ac75d725f51b5cb3e5d5de206d86
2025-04-09 13:54:27 -07:00
Matt Joras
67ce39cfdd Remove exception throwing from the stream manager and flow control.
Summary: I started with the QuicStreamManager, but it turns out that the path from the manager up to the close path touches a LOT, and so this is a big diff. The strategy is basically the same everywhere, add a folly::Expected and check it on every function and enforce that with [[nodiscard]]

Reviewed By: kvtsoy

Differential Revision: D72347215

fbshipit-source-id: 452868b541754d2ecab646d6c3cbd6aacf317d7f
2025-04-07 23:45:33 -07:00
Paul Farcasanu
aa90d99d76 move qlog to transport lite
Summary:
Context: T210787480

I want to add a client-side qlog that will allow us to inspect client behavior during the 0rtt bug.

Reviewed By: jbeshay

Differential Revision: D71145234

fbshipit-source-id: 7816f0a759ba4f60107aaf40c4376ced7c5d03f8
2025-04-01 20:10:07 -07:00
Alan Frindell
e5bbd627e2 Remove Background state priority changes
Summary: These aren't used anywhere and we're going to start refactoring the priority implementation.

Reviewed By: jbeshay, hanidamlaj

Differential Revision: D68657305

fbshipit-source-id: e4a3a5a991bac99afef1362adb2663a50766d2c7
2025-01-28 10:26:42 -08:00
Joseph Beshay
7dd1b673d1 Remove MVFST_USE_LIBEV references since they are not needed anymore
Summary: As title.

Reviewed By: mzlee

Differential Revision: D68643792

fbshipit-source-id: 328d0a7c48f85da0d5850d9f0b51cdff24c4708b
2025-01-24 19:32:23 -08:00
Aman Sharma
1cc00f77a4 Move core functionality to QuicTransportBaseLite [24/n]
Summary:
There are many files in this diff, but the relevant ones are:
* quic/api/QuicSocket.h
* quic/api/QuicSocketLite.h
* quic/api/QuicTransportBase.h
* quic/api/QuicTransportBaseLite.cpp
* quic/observer/SocketObserverContainer.h

The purpose of this is to include the observer functionality within the Lite class. Ideally, we'd remove it from the Lite class, but that's going to require some more detailed changes to the interfaces we're using, because observers are used quite a lot within common code (for example, AckHandlers.cpp).

I'll make those changes some time after the QuicTransportBase split, as they're going to take a while.

Reviewed By: jbeshay, mjoras, kvtsoy

Differential Revision: D65685667

fbshipit-source-id: feb07bcf35d6af2e5c2b538ff463b01b67c6aff9
2024-11-14 13:02:10 -08:00
Crystal Jin
a5fd828b90 Move setPacingFunction to when pacer is set
Reviewed By: hanidamlaj

Differential Revision: D65845962

fbshipit-source-id: 9d14e9845c6232b9825c20c7c67e2f49ac2fed73
2024-11-13 10:39:16 -08:00
Aman Sharma
a4247ec4d5 Move core functionality to QuicTransportBaseLite [21/n]
Summary: See title.

Reviewed By: mjoras

Differential Revision: D65282152

fbshipit-source-id: 273a2df9aca0aa84b2e1137d99a473e02de0953b
2024-11-01 11:46:43 -07:00
Aman Sharma
ae605980c5 Move core functionality to QuicTransportBaseLite [20/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64971971

fbshipit-source-id: 91c9fddcf77bbf26fa86bb00a1fa7f6c3b6f55dc
2024-10-30 10:53:30 -07:00
Aman Sharma
784bd91424 Move core functionality to QuicTransportBaseLite [19/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64771233

fbshipit-source-id: 3584af1ce77a4ca53de83a2fb6bf8f6d3f9ed999
2024-10-24 15:01:02 -07:00
Aman Sharma
6691c8dde2 Move core functionality to QuicTransportBaseLite [18/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64771210

fbshipit-source-id: 58e79264bfc2826ba0822f1bb51877d3d7c8d06d
2024-10-24 15:01:02 -07:00
Aman Sharma
384c39f862 Move core functionality to QuicTransportBaseLite [17/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64547922

fbshipit-source-id: fa1e7c22122062b468878a232f545ba1f2619925
2024-10-23 18:25:46 -07:00
Aman Sharma
6875e7cdf5 Move core functionality to QuicTransportBaseLite [16/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64546909

fbshipit-source-id: de8989a0c292dfa8ff05d943ffaee23f1e6923d3
2024-10-23 13:39:16 -07:00
Aman Sharma
520ae73630 Move core functionality to QuicTransportBaseLite [15/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64542784

fbshipit-source-id: a155c441b3d2cf0a8220e7ddebd94f0335cb9420
2024-10-23 10:02:08 -07:00
Aman Sharma
c1b9dcbb89 Move core functionality to QuicTransportBaseLite [14/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64342347

fbshipit-source-id: 721414fdca39f70d8902b3df5afb0fde0d171480
2024-10-16 12:40:37 -07:00
Aman Sharma
0882df9999 Move core functionality to QuicTransportBaseLite [13/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64342282

fbshipit-source-id: 93faad3e53b1aba27dae268fc690480acf27d705
2024-10-16 12:40:37 -07:00
Aman Sharma
40e0652725 Move core functionality to QuicTransportBaseLite [12/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64338559

fbshipit-source-id: 7c2c884e0c855c443874ab1b891bd285d24c4cf1
2024-10-16 12:40:37 -07:00
Aman Sharma
5c8a4463ea Move core functionality to QuicTransportBaseLite [11/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64185699

fbshipit-source-id: 7f79eeb4f1f1cf043b8e3e3a513f407c796dc51e
2024-10-14 11:58:31 -07:00
Aman Sharma
cfbdfda64b Move core functionality to QuicTransportBaseLite [10/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64065782

fbshipit-source-id: b0fb37e57b59ac6f28cf6f0b2d59d750a63398ca
2024-10-14 11:58:31 -07:00
Aman Sharma
9374a6b0e4 Move core functionality to QuicTransportBaseLite [9/n]
Summary: See title.

Reviewed By: kvtsoy

Differential Revision: D64065220

fbshipit-source-id: e027275d565ee8967de4eb4855475244bae334a0
2024-10-14 11:58:31 -07:00
Aman Sharma
b7169e3cf7 Move core functionality to QuicTransportBaseLite [8/n]
Summary: See title.

Reviewed By: mjoras

Differential Revision: D64065153

fbshipit-source-id: 5c9515dcaba1ef1f30d49f701e366f715854527a
2024-10-09 17:37:33 -07:00
Aman Sharma
c62dac180e Move core functionality to QuicTransportBaseLite [7/n]
Summary: See title.

Reviewed By: mjoras

Differential Revision: D64065113

fbshipit-source-id: 31f9a29a88bf763156d42c49df9db0f6f8e1a9d0
2024-10-09 17:37:33 -07:00
Aman Sharma
a253b7d782 Move core functionality to QuicTransportBaseLite [6/n]
Summary: See title.

Reviewed By: mjoras

Differential Revision: D63994476

fbshipit-source-id: 136e9ba9a972ac58b8a5fc6b336f6c3a4eaf38f5
2024-10-09 17:37:33 -07:00
Aman Sharma
7be7cfffb0 Move core functionality to QuicTransportBaseLite [5/n]
Summary: See title.

Reviewed By: mjoras

Differential Revision: D63986096

fbshipit-source-id: 5543b943acf5397db3951186f50181e1c31b7e0b
2024-10-08 11:12:03 -07:00
Aman Sharma
e0e445ff01 Move core functionality to QuicTransportBaseLite [4/n]
Summary: See title.

Reviewed By: mjoras

Differential Revision: D63984103

fbshipit-source-id: f21f3c4759dfa463319cefb7731c793c0fa9905d
2024-10-08 11:12:03 -07:00
Aman Sharma
5a9ebd333d Move core functionality to QuicTransportBaseLite [3/n]
Summary: See title.

Reviewed By: mjoras

Differential Revision: D63917728

fbshipit-source-id: 4e5389c1747b59cf30fea37ed9e5802007f2e49b
2024-10-08 11:12:03 -07:00
Aman Sharma
e5c822b9d4 Move core functionality to QuicTransportBaseLite [2/n]
Summary: See title.

Reviewed By: mjoras

Differential Revision: D63914228

fbshipit-source-id: 3860b33688a4efe99374a55dde226b7ceaab8d2f
2024-10-08 11:12:03 -07:00
Aman Sharma
0b2743fdae Move core functionality to QuicTransportBaseLite [1/n]
Summary: See title

Reviewed By: mjoras

Differential Revision: D63860679

fbshipit-source-id: b7116792c2bf99a98f62d719febddd133cce94d5
2024-10-04 17:28:20 -07:00
Riten Gupta
b4790c8429 change bbr2 parameters for testing in prod
Summary: Sim studies showed improved performance for some cases with experimental pacer false, no pacing of init cwnd, and increased startup pacing gain.

Reviewed By: mjoras

Differential Revision: D63723767

fbshipit-source-id: 7c54076510530ed4da65ce8f00027c2ed251ea32
2024-10-04 10:27:39 -07:00
Konstantin Tsoy
818757c454 Add inline write option for sending pings
Summary:
We originally added it for onNetworkDdata only e.g.
https://fburl.com/code/lub7h950, but we should do it on sending pings as well

Reviewed By: mjoras

Differential Revision: D63670960

fbshipit-source-id: ad6096ddc92f00669239bcbb37e65d48238020b9
2024-09-30 19:34:41 -07:00
Matt Joras
3f21e7130c Fix buffered data case for initial / handshake
Summary: This case was missing. If we don't do this then if we buffer a packet on EAGAIN while we don't have initia/handshake data to write, we will loop on the write callback and do empty write loops.

Reviewed By: kvtsoy

Differential Revision: D63492172

fbshipit-source-id: 94ac1c37b2015d38694b9aa3be2744c9bbbe6bee
2024-09-27 19:41:08 -07:00
Crystal Jin
0ed5f1c98a Log rtt variance and latest rtt
Summary: As title

Reviewed By: kvtsoy

Differential Revision: D62965330

fbshipit-source-id: 93f865633e589f97589a8b7b06609e8995abf53d
2024-09-19 12:38:49 -07:00
Hani Damlaj
07f2980f43 fix onBidirectionalStreamsAvailable
Summary:
fixes the arg passed to the ::onBidirectionalStreamsAvailable callback

#facebook:
i accidentally introduced a bad operator precedence bug in a refactor; this fixes that and the unit test

luckily HQSession doesn't consume the argument passed to the callback

Reviewed By: knekritz

Differential Revision: D62765762

fbshipit-source-id: 7ae206d5036fc744485736f92fd366ce99103d58
2024-09-17 00:11:53 -07:00
Konstantin Tsoy
4df319dee3 Delay writes when networkDataPerSocketRead=true until the read loop is done
Summary: Delay writes when networkDataPerSocketRead=true until the read loop is done

Reviewed By: mjoras

Differential Revision: D62302229

fbshipit-source-id: 858bed523b5a46bd52fe71f6f0e8b23f5dd4e46d
2024-09-10 11:13:55 -07:00
Matt Joras
e81c40b2f7 Add option to do an inline write after a read event.
Summary: Presently updateWriteLooper will always schedule a loop callback to do the write loop. Add an option to inline trigger the writes after the read event.

Reviewed By: kvtsoy, sharmafb

Differential Revision: D62192192

fbshipit-source-id: 30991608f57fbfa097a7522c0731d25b8e528345
2024-09-04 15:15:22 -07:00
Konstantin Tsoy
777bdabe21 Call invokeReadDataAndCallbacks() when processCallbacksPerPacket is set
Summary: Missed this call because processCallbacksAfterNetworkData() used to call it before

Reviewed By: mjoras

Differential Revision: D61891333

fbshipit-source-id: 078e9dce5e5f91f389bdb38b0a589a3256dd873b
2024-08-27 23:37:56 -07:00
Aman Sharma
a60a3a0aeb More readable delivery callback code
Summary: The prior `while (maxOffsetToDeliver.has_value()) {` was misleading because `maxOffsetToDeliver` doesn't change in the body of the while loop. I'm changing the structure so as to make it more intuitive as to what's happening here.

Reviewed By: hanidamlaj

Differential Revision: D61801508

fbshipit-source-id: fb91b183316b281cf74cbb33a67f7080e7d8a6f8
2024-08-27 19:18:35 -07:00
Aman Sharma
93bb817940 Fix flaxy test SendResetSyncOnAck
Summary: See title.

Reviewed By: mjoras

Differential Revision: D61634417

fbshipit-source-id: 644fce59d78cf97d0741fd30bd2f1a6e681b0768
2024-08-26 13:16:36 -07:00
Aman Sharma
ff3cc2d753 Add Software rx timestamp to PacketsReceivedEvent
Summary: I'm adding the software rx timestamp to `PacketsReceivedEvent` so that it's available in `SocketObserverInterface::packetsReceived`.

Reviewed By: mjoras

Differential Revision: D61485649

fbshipit-source-id: 05170acbcfd1fc8e6a2fce4d2cc8f3f2f7441134
2024-08-23 18:44:04 -07:00
Matt Joras
52c950293f Add option to process callbacks per received packet
Summary: This gives an option to process application callbacks per received and processed packet, rather than after a whole batch has been received.

Reviewed By: kvtsoy

Differential Revision: D61626616

fbshipit-source-id: cac434adff79eda738c2c4924a0080ecdaac1a25
2024-08-21 15:33:14 -07:00