Skip to content

Conversation

@PaulRalnikov
Copy link
Collaborator

closes #496

Copy link
Contributor

@ArtyomPeshkov ArtyomPeshkov left a comment

Choose a reason for hiding this comment

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

Move AckInfo to utils and add on_ack overload
Think about MPLB packet distribution (delays management)

Copy link
Contributor

@Az3git Az3git left a comment

Choose a reason for hiding this comment

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

Not all

flow_weak.lock()->send(
std::vector<PacketInfo>(1, std::move(packet_info)));
});
m_packets_in_flight++;
Copy link
Contributor

Choose a reason for hiding this comment

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

m_packets_in_flight increases but does not decrease anywhere

return;
}
auto mplb = mplb_weak.lock();
mplb->m_cc->on_ack(info.rtt, info.avg_rtt, info.ecn_flag);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
mplb->m_cc->on_ack(info.rtt, info.avg_rtt, info.ecn_flag);
mplb->m_cc->on_ack(info.rtt, info.avg_rtt, info.ecn_flag);
mplb->m_packets_in_flight--;

TimeNs pacing_delay = m_cc->get_pacing_delay();
TimeNs shift(0);

std::size_t packets_count = std::ceil(data.size / m_packet_size);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
std::size_t packets_count = std::ceil(data.size / m_packet_size);
auto packets_count = (data.size + m_packet_size - SizeByte(1)) / m_packet_size;

It's a safe option, but if everything is fine, leave it as is.

std::weak_ptr<SingleCCMplb> mplb_weak = shared_from_this();
PacketCallback packet_callback = [observer, mplb_weak,
flow_weak](PacketAckInfo info) {
observer->on_single_callback();
Copy link
Contributor

Choose a reason for hiding this comment

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

If the CallbackObserver calls the final callback() on the last packet, the custom callback may be triggered before the CC/delivered/inflight update of the last packet. This can break tests/logic if the user immediately looks at get_context() in the callback.

Please check it

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.

FEAT: MPLB with single CC

4 participants