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

157 Commits

Author SHA1 Message Date
Joseph Beshay
db728cd1a3 Add CONN_MIGRATION knob to enable/disable connection migration at the server
Summary: As title.

Reviewed By: kvtsoy

Differential Revision: D48246018

fbshipit-source-id: 9d905035d11d8d34586b5a7deaf0c7b379a39048
2023-08-16 10:24:01 -07:00
Christian Clauss
b8396fc119 Fix typos discovered by codespell
Summary:
`codespell --ignore-words-list=arithmetics,atleast,crate,crated,deriver,ect,hel,onl,startin,whats --skip="*.lock"`
* https://pypi.org/project/codespell

X-link: https://github.com/facebookincubator/mvfst/pull/307

Reviewed By: hanidamlaj, lnicco

Differential Revision: D47809078

Pulled By: kvtsoy

fbshipit-source-id: 566557f2389746db541ff265a5dec8d6404b3701
2023-07-26 17:10:41 -07:00
Konstantin Tsoy
73edee8252 Back out "Fix typos discovered by codespell"
Summary:
Original commit changeset: 337824bc37bc

Original Phabricator Diff: D47722462

Reviewed By: jbeshay, terrelln, lnicco

Differential Revision: D47801753

fbshipit-source-id: 795ffcccbc2223608e2a707ec2e5bcc7dd974eb3
2023-07-26 12:49:13 -07:00
Joseph Beshay
d85f726e36 Consolidate logic for setting the congestion controller in one function
Summary: Ensure all CCA-related settings are included in setCongestionControl(), and that it's called from the knob setting the congestion controller.

Reviewed By: kvtsoy

Differential Revision: D47741830

fbshipit-source-id: ff1d2347581c61a58f2caaff8189126930bf4e04
2023-07-25 19:48:01 -07:00
Facebook Community Bot
9d89b66485 Re-sync with internal repository 2023-07-25 09:45:22 -07:00
Joseph Beshay
cbc802ea1a Remove 3 unused quic transport knobs
Summary: As title.

Reviewed By: kvtsoy

Differential Revision: D47534110

fbshipit-source-id: f613c012004315134db114f9f0f026455c8d8d8d
2023-07-24 20:00:07 -07:00
Joseph Beshay
7db19c1f19 Add new CC_CONFIG knob to dynamically control CCA features
Summary:
Adds a new CC_CONFIG knob that carries a JSON blob that gets parsed into the transportSetting.ccaConfig struct.

Sample knob values:
```
{"52397": "{\"conservativeRecovery\": false}"}
{"52397": "{\"conservativeRecovery\": true, \"ackFrequencyConfig\":{\"minRttDivisor\": 77}}"}
```

Reviewed By: hanidamlaj

Differential Revision: D47309438

fbshipit-source-id: 0a4e941b9e4231bd333174472827044b1b49ac96
2023-07-14 14:55:29 -07:00
Joseph Beshay
471fa6f8dc Change BBRConfig to CongestionControlConfig
Summary: Rename transportSetting.BBRConfig to CongestionControlConfig to prepare it for being used by other CCAs too.

Reviewed By: hanidamlaj, mjoras

Differential Revision: D47309439

fbshipit-source-id: 56d0ddc9752789709c54a4f7cc595f94c656e49e
2023-07-14 14:55:29 -07:00
Konstantin Tsoy
4a0dd1e2a4 QuicAsyncUDPSocketWrapper
Reviewed By: jbeshay

Differential Revision: D46379200

fbshipit-source-id: f6a7c1cf68108872e05e6fd8adb7f00aae22b2ed
2023-07-11 15:21:15 -07:00
generatedunixname89002005287564
131da0d4bd quic_0
Reviewed By: DenisYaroshevskiy

Differential Revision: D47061673

fbshipit-source-id: c3e06ffc905015fa5e54a98dc67efe5732d700fe
2023-06-28 07:23:56 -07:00
Hani Damlaj
debb68639d remove WindowedCounter
Summary: as title, cleaning up some unused files & references

Reviewed By: mjoras

Differential Revision: D46843918

fbshipit-source-id: 08be5696d76f4f23df0f07bfd1ede5703d358691
2023-06-26 22:16:40 -07:00
Joseph Beshay
931abc64af Separate transport settings for pacing tick and the pacing timer resolution
Summary:
The pacingTimerTickInterval transport setting conflates two options: the minimum interval a pacer can use, and the resolution of the underlying timer. This means that a higher value leads to lower timer resolution and less pacing accuracy.

This change adds a separate parameter for the timer resolution to ensure that a larger pacing tick does not degrade the pacer accuracy.

Reviewed By: mjoras

Differential Revision: D46564066

fbshipit-source-id: 0d0e54077b80da03e6e6c9baaab49a4c969966b6
2023-06-20 15:18:38 -07:00
Konstantin Tsoy
adf16f9a07 Remove libccp from mvfst
Summary: We don't use it, and the OSS lib hasn't been updated in a while.

Reviewed By: mjoras

Differential Revision: D46707559

fbshipit-source-id: ec102a52183a736cfb1c0241600816a837062108
2023-06-15 18:17:53 -07:00
Konstantin Tsoy
dccfc706b5 QuicEventBase wrapper
Summary:
Create and use an actual wrapper around folly::EventBase.
Later an interface will be added that the wrapper will be implementing.

Reviewed By: jbeshay

Differential Revision: D45822401

fbshipit-source-id: 3b33f796c31043ec2881b753a9b60943bdf91f1d
2023-06-15 17:12:24 -07:00
Matt Joras
373b9e24ba Only discount full packets from the packet limit.
Summary:
Right now small packets will cause us to subtract from the packet limit during write loops. This is generally okay when using just non-DSR data. For DSR though there is an issue where if we only write a single small packet from the non-DSR path (like an ACK) we will discount it from the amount of packets the DSR path can write.

The existing workaround for this is to only discount the non-DSR path write if the number of bytes written is less than half a packet's worth. This heuristic is incomplete though and doesn't consider the cases like the following:
1. Packet limit is 5
2. Normal path writes 4 packets of size 1232, 1232, 1232, 20.
3. The DSR path only gets one packet.

The reason for this is because the normal path also wrote full packets, but ended with a short packet. The account for this we just have to discount in terms of full packet's written. In the above example, the DSR path would get the chance to write two packets. Thus we would exceed the packet limit by one packet, but it would get us closer to the desired amount of data on the wire.

Reviewed By: kvtsoy

Differential Revision: D46633105

fbshipit-source-id: 00d92499ab73fc746ea5fdb6ff31e10f06b98666
2023-06-13 16:42:05 -07:00
Matt Joras
8a7fedfe1d Add time-based QUIC_STATS
Summary:
The idea here is to add a notion of time-based sampling of certain QUIC_STATS. This allows accounting to be done via consistent distributions for comparisons.

For now limit to the server, and only implement for inflight bytes, SRTT, and CCA bandwidth.

Reviewed By: jbeshay

Differential Revision: D46410903

fbshipit-source-id: a5db1ec720a0f8bf54e04d66c0d68686660e8eaa
2023-06-12 09:48:10 -07:00
Matt Joras
6ecdb35ade Minimum packets per stream before next() moves forward
Summary:
The idea here is to allow a way to do incremental stream priorities while switching between streams as aggressively.

Achieving this is somewhat tricky. The easiest place to track this is to make it so the iterator in QuicPriorityQueue no-op next() until a counter reaches an increment.

This is especially impacftul for DSR, where round robining per packet is almost pathologically bad both for CPU impact but also spurious losses and low bandwidth estimates.

Thoughts?

(Note: this ignores all push blocking failures!)

Reviewed By: kvtsoy

Differential Revision: D46268308

fbshipit-source-id: cd5b924141365f61f8a3363bc9cb38a62e5c94cf
2023-06-01 14:11:31 -07:00
Matt Joras
35a2d34843 Use a single queue for scheduling DSR and non-DSR streams.
Summary:
The write loop functions for DSR or non-DSR are segmented today. As such, so are the schedulers. Mirroring this, we also currently store the DSR and non-DSR streams in separate write queues. This makes it impossible to effectively balance between the two without potential priority inversions or starvation.

Combining them into a single queue eliminates this possibility, but is not entirely straightforward.

The main difficulty comes from the schedulers. The `StreamFrameScheduler` for non-DSR data essentially loops over the control stream queue and the normal write queue looking for the next stream to write to a given packet. When the queues are segmented things are nice and easy. When they are combined, we have to deal with the potential that the non-DSR scheduler will hit a stream with only DSR data. Simply bailing isn't quite correct, since it will just cause an empty write loop. To fix that we need check, after we are finished writing a packet, if the next scheduled stream only has DSR data. If it does, we need to ensure `hasPendingData()` returns false.

The same needs to be done in reverse for the DSR stream scheduler.

The last major compication is that we need another loop which wraps the two individual write loop functions, and calls both functions until the packet limit is exhausted or there's no more data to write. This is to handle the case where there are, for example, two active streams with the same incremental priority, and one is DSR and the other is not. In this case each write loop we want to write `packetLimit` packets, flip flopping between DSR and non DSR packets.

This kind of round robining is pathologically bad for DSR, and a future diff will experiment with changing the round robin behavior such that we write a minimum number of packets per stream before moving on to the next stream.

This change also contains some other refactors, such as eliminating `updateLossStreams` from the stream manager.

(Note: this ignores all push blocking failures!)

Reviewed By: kvtsoy

Differential Revision: D46249067

fbshipit-source-id: 56a37c02fef51908c1336266ed40ac6d99bd14d4
2023-06-01 14:11:31 -07:00
Matt Joras
541b224580 Don't write if CCA out of bytes
Summary: We shouldn't attempt to write DSR data if we run out of congestion control bytes. This will just cause an empty DSR write, which shouldn't have any negative impact but it causes tperf spam.

Reviewed By: jbeshay

Differential Revision: D46126190

fbshipit-source-id: 390e04c5d6182a2e0e61d63e806522d1ea410a30
2023-05-24 10:52:01 -07:00
Matt Joras
96b2c1b37d Control write loop time limit from knob.
Summary:
This has been hardcoded to SRTT/25 for a long time. However, especially when using DSR this might not be the most appropriate since it can start to get close to real world SRTTs.

Control it via a knob, and also add the behavior such that setting it to 0 effectively disables the time limit.

Reviewed By: jbeshay

Differential Revision: D46084438

fbshipit-source-id: 7dc619fdff1bd5c3f8654c4936200e0340ef94f2
2023-05-22 16:15:24 -07:00
Matt Joras
b89882a772 Add TransportSetting and knob for default priority.
Summary: Allows the default stream priority (which also means scheduling policy) to be set via TransportSettings.

Reviewed By: jbeshay, hanidamlaj

Differential Revision: D45881729

fbshipit-source-id: fcb72022cd6eac2f1dafc55173d5a46a72a95dbc
2023-05-18 13:51:53 -07:00
Matt Joras
c95b297cb1 ACK_FREQUENCY Knob logging fix.
Summary: Messed up the log line.

Reviewed By: jbeshay

Differential Revision: D45913954

fbshipit-source-id: c3199dd6ecf114e75b934759c2b9054d38c9f17d
2023-05-17 14:14:08 -07:00
Joseph Beshay
a6897c8284 Fix typo in log for PACING_TIMER_TICK knob
Summary: The log for PACING_TIMER_TICK knob was referring to another knob name. This fixes it.

Reviewed By: sharmafb

Differential Revision: D45834217

fbshipit-source-id: c26c481633218dc165a65efcf029e7c636947dea
2023-05-15 10:02:12 -07:00
Matt Joras
51333a1583 Don't subtract out small non DSR packets from packet limit.
Summary: For non-DSR streams we can fill a packet that has e.g. stream limit updates and flow control with stream data. With DSR, we can't do that and thus packets that contain this data end up counting against the packet limit. This means that we often end up writing fewer packets per write loop when using DSR. Account for this by basically discounting the non-DSR packet in a write loop if it was "small".

Reviewed By: shodoco

Differential Revision: D45754930

fbshipit-source-id: ca494a4bd042de05c12a4d45e80dd5582fe12248
2023-05-10 18:52:17 -07:00
Matt Joras
25e8eb2f4e Randomly write DSR or non DSR first.
Summary:
Due to the fact that store DSR and non DSR streams in separate priority queues, we end up having to make a decision on which to write first.

Longer term we should merge them into a single priority queue, but in the meantime to mitigate potential starvation, randomly flip flop between which we write first in a given write loop.

Reviewed By: jbeshay, shodoco

Differential Revision: D45701230

fbshipit-source-id: 894179e457a4d6f7364767108f9290ff267eb977
2023-05-09 14:27:17 -07:00
Matt Joras
b5b3ad47b7 Add optional "ACK clocking" mode to the write looper.
Summary:
We've long seen issues where paced congestion controllers can't keep up with the sending rate at low RTTs. While we have one mitigation for this, it only works after the pacing timer has fired. This introduces a new behavior that effectively makes the write looper ACK clock some of the time.

The way it works is that when we call updateWriteLooper, if we've already missed the next pacing wakeup or it is going to fire soon (within 1ms), we cancel it and do a write in this loop. This effectively gives us multiple opportunities to write each burst, e.g. after receiving an ACK.

Reviewed By: kvtsoy

Differential Revision: D45052984

fbshipit-source-id: 591b6f5f374f4886dffa1e9be78df02d17fcc27c
2023-04-18 15:48:23 -07:00
Hani Damlaj
a0e456bc03 migrate folly::none assignment operator to .reset()
Summary: - .reset() is probably fractionally less costly than the assignment operator?

Reviewed By: sharmafb

Differential Revision: D43579041

fbshipit-source-id: 4838b6c21e94197782cf56866950be1dbf65b106
2023-03-03 05:39:57 -08:00
Konstantin Tsoy
6beae9d280 Protect server transport in a callback
Reviewed By: hanidamlaj

Differential Revision: D43546517

fbshipit-source-id: ede330167c5281ff8975acbf1bdbc27e420597d8
2023-02-24 11:12:37 -08:00
Konstantin Tsoy
377260f704 Remove d6d code
Summary: we're not using it

Reviewed By: mjoras

Differential Revision: D43482344

fbshipit-source-id: 05ac6792848e32e7c1bcf53a2df172852b5def62
2023-02-23 20:11:24 -08:00
Brandon Schlinker
925472bdfc Store weak_ptr to SocketObserverContainer in ConnectionStateBase
Summary:
This diff changes `QuicConnectionStateBase` so that it stores a `std::weak_ptr<SocketObserverContainer>` instead of a `std::shared_ptr<SocketObserverContainer>`.

- `QuicConnectionStateBase` needs a pointer to the `SocketObserverContainer` so that loss / ACK / other processing logic can access the observer container and send the observers notifications. There may not be a `SocketObserverContainer` if the `QuicTransportBase` implementation does not support it.
- A `SocketObserverContainer` must not outlive the instance of the `QuicTransportBase` implementation that it is associated with. This is because observers are notified that the object being observed has been destroyed when the container is destroyed, and thus if the container outlives the lifetime of the transport, then the observers will think the transport is still alive when it is in fact dead.
- By storing a weak pointer to the `SocketObserverContainer` in the `QuicConnectionStateBase`, we provide access to the observer container without extending its lifetime. In parallel, because it is a managed pointer, we avoid the possibility of dereferencing a stale pointer (e.g., a pointer pointing to an object that has since been destroyed).

Reviewed By: mjoras

Differential Revision: D42856161

fbshipit-source-id: f35558a21fea91ba794adcf9b573dd48a626ea1f
2023-01-30 22:45:59 -08:00
Matt Joras
1275798146 Make the AckState for Initial/Handshake a unique_ptr
Summary:
We don't need to carry these states after the handshake is confirmed, so make them pointers instead. This will facilitate adding a structure to the AckState for tracking duplicate packets.

(Note: this ignores all push blocking failures!)

Reviewed By: hanidamlaj

Differential Revision: D41626895

fbshipit-source-id: d8ac960b3672b9bb9adaaececa53a1203ec801e0
2022-12-20 11:08:43 -08:00
Sharad Jaiswal (Eng)
328c78d0e2 Add received packets timestamps to AckState
Summary:
Store timestamps/packet numbers of recently received packets in AckState.

 - The maximum number of packets stored is controlled by kMaxReceivedPktsTimestampsStored.
- The packet number of entries in the deque is guarenteed to increase
   monotonically because an entry is only added for a received packet
  if the packet number is greater than the packet number of the last
  element in the deque (e.g., entries are not added for packets that
  arrive out of order relative to previously received packets).

Reviewed By: bschlinker

Differential Revision: D37799023

fbshipit-source-id: 3b6bf2ba8ea15219a87bbdc2724fe23eebe66b70
2022-11-15 20:14:57 -08:00
Joseph Beshay
772b47adaa Do not use LOG_EVERY_N
Summary:
Fixes build error from Github actions
```
D:\a\mvfst\mvfst\quic\server\QuicServerTransport.cpp(1072): error C3861:
'__sync_add_and_fetch': identifier not found

```

Reviewed By: hanidamlaj

Differential Revision: D40327603

fbshipit-source-id: afae1b661322e80156c7d69b577f35f41b67ee73
2022-11-10 16:17:32 -08:00
Matt Joras
953235fbc7 Track largest packet acked per DSR stream.
Summary:
The normal loss detection only considers the reordering threshold per packet by comparing it with the largest ACKed packet in the ACK. This is largely based on the fact that QUIC packet numbers are monotonically increasing.

However, when using DSR there is a potential for a different host to be writing the packets to the wire. When there are multiple hosts doing this, there is a degree of reordering that is expected to happen.

Thus we can change the loss detection logic to adjust the largest packet ACKed and use the largest packet ACKed for a given DSR stream when the packet is a DSR packet. This allows for the natural reordering while detecting loss within the DSR sender's timeline of sent packets.

Note that this probably doesn't catch all of the nuances that can happen with the reordering, but it is a good start.

Reviewed By: kvtsoy

Differential Revision: D40647572

fbshipit-source-id: d84c6cd8040fb8c044ddd68fb1abc049ccddfc44
2022-10-27 14:35:11 -07:00
Matt Joras
c8f357156e Differentiate ACK_FREQUENCY policy early in connection.
Summary: This changes the experimental behavior of BBR sending ACK_FREQUENCY frames. Now instead of using the static ack eliciting threshold, early in the connection BBR will set the threshold to 2 which has been empirically shown to be a good "initial" value.

Reviewed By: jbeshay

Differential Revision: D40438721

fbshipit-source-id: 184b8025581b6152eea97f9b557b6343d980322d
2022-10-17 17:54:45 -07:00
Matt Joras
06aaca5fcd Add transport settings for disabling adaptive loss thresholds for DSR
Summary:
This is useful so we can run experiments that turn this feature off while we turn ACK_FREQUENCY policies on.

(Note: this ignores all push blocking failures!)

Reviewed By: yairgott

Differential Revision: D40148536

fbshipit-source-id: 84aa4a0639b43c8721db0db6885b6af6e1701bdd
2022-10-07 08:45:14 -07:00
Matt Joras
4c2a067ec4 Control ACK_FREQUENCY from BBR
Summary:
This introduces the ability for BBR to control ACK_FREQUENCY. It also introduces a knob which will let us experiment with different policies.

This code makes BBR issue a new ACK_FREQUENCY every round trip. This may be excessive, so BBR will track the last frame sent, and only send a new one if the new value is sufficiently different in terms of milliseconds.

Note that the only dynamic part of the frame currently will be the max ack delay, which is in terms of fractional RTTs. It is not clear yet how we should vary the other parameters dynamically.

Reviewed By: kvtsoy

Differential Revision: D39910417

fbshipit-source-id: 73cfdac40ca52185c33322017a893e5a02ee58e8
2022-09-30 22:42:54 -07:00
Matt Joras
5ad55f11e0 Temporarily disable remove from loss on spurious knob.
Summary:
As in title. Just remove the knob trigger for now as it is causing some issues with DSR.

(Note: this ignores all push blocking failures!)

Reviewed By: shodoco

Differential Revision: D39840220

fbshipit-source-id: 253e0b2c72f9926b902585df8e5a43bebc24b79b
2022-09-26 21:34:14 -07:00
Brandon Schlinker
5b8e0de5bd Improve transport close handling and observability
Summary:
The current `close` observer event marks when `closeImpl` is called. However, the actual close of the socket may be delayed for some time while the socket drains. I've changed the existing event to `closeStarted` and added a new event `closing` that marks the close of the underlying `AsyncUDPSocket`.

Adding the `closeStarted` event required two other changes which are difficult to separate from this diff:
- When a transport is destroyed, `QuicTransportBase` was calling `closeImpl` and also closing the UDP socket. However, because the `folly::ObserverContainer` used to store observers is maintained in classes that derive from `QuicTransportBase`, the observers are gone by the time the UDP socket is closed in the base class destructor. Thus, the UDP socket should be closed by the derived classes in their respective destructors. This requirement is inline with the existing code: `closeImpl` is called by all derived classes in their destructors. Made this change and added `DCHECK` statements in the `QuicTransportBase` destructor to ensure that derived classes cleanup after themselves.
- Writing tests with draining enabled and disabled required being able to set the transport settings. However, all of the existing `QuicTypedTransportTest` test cases were designed to operate after the connection was accepted (for the server impls) or established (for client impls), and transport settings cannot be updated at this state. Resolving this required adding new test classes in which the accept/connect operation is delayed until requested by the test.

Reviewed By: mjoras

Differential Revision: D39249604

fbshipit-source-id: 0ebf8b719c4d3b01d4f9509cf2b9a4fc72c2e737
2022-09-10 10:39:11 -07:00
Hani Damlaj
0ae79027df Issue Conn IDs As Needed
Summary:
- continually issuing new connection ids to peer as old connections ids are retired through RETIRE_CONN_ID frames
- add logic to parse and act on receiving RETIRE_CONN_ID frame

Reviewed By: mjoras

Differential Revision: D38443561

fbshipit-source-id: 82fb679f482fd69c7b3a3385693d2e5575e92703
2022-08-25 17:47:45 -07:00
Duc Nguyen
efb1923fd0 Handle MAX_PACING_RATE_KNOB_SEQUENCED transport knob
Summary: Handle MAX_PACING_RATE_KNOB_SEQUENCED transport knob with which a client can suggest a limit on the pacing rate used by the server, if it has pacing enabled. This knob also include a sequence number with which the server can use to determine out-of-order frames.

Reviewed By: bschlinker

Differential Revision: D37062350

fbshipit-source-id: 981f0c9df99cf30de6c676784409a43d45f62ff2
2022-06-29 19:01:11 -07:00
Duc Nguyen
5831b7d7fe Support both uint64_t and std::string as value in TransportKnobParam
Reviewed By: bschlinker

Differential Revision: D37056877

fbshipit-source-id: de6cee779424d5b4ce7fb741d5a1bedcf3de3736
2022-06-28 12:18:33 -07:00
Matt Joras
a83aa2c5d7 Split adaptive thresholds to reorderng and time.
Summary: We want to experiment with just using adaptive thresholds for reordering.

Reviewed By: kvtsoy

Differential Revision: D37190894

fbshipit-source-id: 8c388d18c65a75ce1740cd2c193f444fe9e86ace
2022-06-20 19:09:43 -07:00
Duc Nguyen
1eeb2a6c0e Add stats for out-of-order transport knob
Reviewed By: bschlinker

Differential Revision: D37043654

fbshipit-source-id: 283e4f63db12cfd6f0ad91474417786ec3b6fd1d
2022-06-10 13:48:28 -07:00
Duc Nguyen
6902d68265 Handle out-of-order MAX_PACING_RATE_KNOB frames
Reviewed By: bschlinker

Differential Revision: D36956938

fbshipit-source-id: 517b9fa053e8c632fe62580b6cb534dc8e7292e3
2022-06-09 18:24:24 -07:00
Konstantin Tsoy
5fc26bc72b Server to use separate max conn id limit
Summary: As opposed to self default.

Reviewed By: mjoras

Differential Revision: D36085316

fbshipit-source-id: c445be64ca32c2b81f68d5bfe84020d33c06fb7c
2022-05-04 20:06:05 -07:00
Matt Joras
abc1308078 Optionally remove from loss buffer on spurious loss.
Summary:
This is a pretty "obvious" thing to do. When a packet with a stream frame is lost, we move that data into the lossBuffer, possibly merging it with existing data.

We track lost packets for a bit to see if they are later ACKed, which indicates the loss was "spurious". When this happens we can search the loss buffer and remove the segment of data which was actually ACKed, obviating a spurious retransmission.

Reviewed By: jbeshay

Differential Revision: D35972951

fbshipit-source-id: f5d0d4beb677d89819d77a8af297db731a8d849e
2022-05-02 12:11:35 -07:00
Hani Damlaj
747c41c30d Fix Probing Bytes Limit
Summary:
- PTOs should not be subject to congestion control limits
- Quickly recover from PTOs being writableBytesLimited by calling onPTOAlarm() as soon as we become unblocked

Reviewed By: mjoras

Differential Revision: D35480409

fbshipit-source-id: 51500db6fff17a7badefea8bda7f63141e97f746
2022-04-19 00:50:36 -07:00
Brandon Schlinker
744ae1f78e Use folly::ObserverContainer for socket observer [4/x]
Summary:
This diff is part of larger change to switch to using `folly::ObserverContainer` (introduced in D27062840).

This diff:
- Changes `LegacyObserver` to inherit from the new `Observer` class by adding a compatibility layer. This compatibility layer enables existing observers to continue to be supported.
- Changes generation of observer events so that they are routed through `ObserverContainer::invokeInterfaceMethod`
- Temporarily removes some of the reentrancy protection that previously existed, as it was not being applied consistently — some events had reentrancy protection, some did not. This will be reintroduced in the next diff.
- Improves some unit tests for observers during the transition process.

Differential Revision: D35268271

fbshipit-source-id: 5731c8a9aa8da8a2da1dd23d093e5f2e1a692653
2022-04-18 04:19:31 -07:00
Brandon Schlinker
f20eb76865 Use folly::ObserverContainer for socket observer [3/x]
Summary:
This diff is part of larger change to switch to using `folly::ObserverContainer` (introduced in D27062840).

This diff:
- Adds methods to `QuicSocket` to support adding and removing `ObserverContainer` observers. By default, `QuicSocket` implementations will not support observers as `QuicSocket::getSocketObserverContainer` returns `nullptr`, and this will cause `QuicSocket::addObserver` and `QuicSocket::removeObserver` to fail gracefully.
- Adds support in `QuicClientTransport` and `QuicServerTransport` for `ObserverContainer` observers by overriding `getSocketObserverContainer`. Each implementation creates an `ObserverContainer` on construction that is destroyed on destruction.
- Adds the `close` event to the new observer interface and adds corresponding support in `QuicTransportBase`. This allows both the old and new observers to receive the close event. The next diff will do a hard cutover of the rest of the events.

Differential Revision: D35000960

fbshipit-source-id: e75807c97f4385532bf36244591a259aa0a2f4cc
2022-04-18 04:19:31 -07:00