forked from quic-go/quic-go
allow sending of ACKs when pacing limited
An endpoint that is only receiving data won't have an accurate estimate of the congestion window, and therefore derive a very low pacing frequency. In this situation it still needs to be able to send frequent ACKs to the peer in order to allow full utilization of the bandwidth. We therefore need to allow ACKs even when pacing-limited.
This commit is contained in:
@@ -1446,10 +1446,8 @@ var _ = Describe("Session", func() {
|
||||
|
||||
It("sends multiple packets, when the pacer allows immediate sending", func() {
|
||||
sph.EXPECT().SentPacket(gomock.Any())
|
||||
sph.EXPECT().HasPacingBudget()
|
||||
sph.EXPECT().HasPacingBudget().Return(true).AnyTimes()
|
||||
sph.EXPECT().TimeUntilSend() // return the zero value of time.Time{}
|
||||
sph.EXPECT().SendMode().Return(ackhandler.SendAny).Times(3)
|
||||
sph.EXPECT().SendMode().Return(ackhandler.SendAny).Times(2)
|
||||
packer.EXPECT().PackPacket().Return(getPacket(10), nil)
|
||||
packer.EXPECT().PackPacket().Return(nil, nil)
|
||||
sender.EXPECT().WouldBlock().AnyTimes()
|
||||
@@ -1463,6 +1461,23 @@ var _ = Describe("Session", func() {
|
||||
time.Sleep(50 * time.Millisecond) // make sure that only 1 packet is sent
|
||||
})
|
||||
|
||||
It("allows an ACK to be sent when pacing limited", func() {
|
||||
sph.EXPECT().SentPacket(gomock.Any())
|
||||
sph.EXPECT().HasPacingBudget()
|
||||
sph.EXPECT().TimeUntilSend().Return(time.Now().Add(time.Hour))
|
||||
sph.EXPECT().SendMode().Return(ackhandler.SendAny)
|
||||
packer.EXPECT().MaybePackAckPacket(gomock.Any()).Return(getPacket(10), nil)
|
||||
sender.EXPECT().WouldBlock().AnyTimes()
|
||||
sender.EXPECT().Send(gomock.Any())
|
||||
go func() {
|
||||
defer GinkgoRecover()
|
||||
cryptoSetup.EXPECT().RunHandshake().MaxTimes(1)
|
||||
sess.run()
|
||||
}()
|
||||
sess.scheduleSending()
|
||||
time.Sleep(50 * time.Millisecond) // make sure that only 1 packet is sent
|
||||
})
|
||||
|
||||
// when becoming congestion limited, at some point the SendMode will change from SendAny to SendAck
|
||||
// we shouldn't send the ACK in the same run
|
||||
It("doesn't send an ACK right after becoming congestion limited", func() {
|
||||
|
||||
Reference in New Issue
Block a user