Skip to content

quic: decouple UDP and QUIC packet writers for direct creation in ActiveQuicListener#45735

Open
fishpan1209 wants to merge 13 commits into
envoyproxy:mainfrom
fishpan1209:pigeon
Open

quic: decouple UDP and QUIC packet writers for direct creation in ActiveQuicListener#45735
fishpan1209 wants to merge 13 commits into
envoyproxy:mainfrom
fishpan1209:pigeon

Conversation

@fishpan1209

Copy link
Copy Markdown
Contributor

…iveQuicListener

Commit Message: quic: decouple UDP and QUIC packet writers for direct creation in ActiveQuicListener
Additional Description: This change separates the UdpPacketWriter and QuicPacketWriter interfaces, enabling the direct creation of QuicPacketWriter within ActiveQuicListener. By decoupling these writers, the system can bypass the EnvoyQuicPacketWriter wrapper when a custom writer factory is available, improving integration efficiency.
Risk Level: low
Testing: unit tests
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

…iveQuicListener

Signed-off-by: Ting Pan <panting@google.com>
@repokitteh-read-only

Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #45735 was opened by fishpan1209.

see: more, trace.

Signed-off-by: Ting Pan <panting@google.com>
Signed-off-by: Ting Pan <panting@google.com>
Signed-off-by: Ting Pan <panting@google.com>
Signed-off-by: Ting Pan <panting@google.com>
@fishpan1209

Copy link
Copy Markdown
Contributor Author

/retest

@fishpan1209

Copy link
Copy Markdown
Contributor Author

/assign @wang178c @RyanTheOptimist

@fishpan1209 fishpan1209 marked this pull request as ready for review June 22, 2026 17:07
@repokitteh-read-only

Copy link
Copy Markdown

CC @envoyproxy/runtime-guard-changes: FYI only for changes made to (source/common/runtime/runtime_features.cc).

🐱

Caused by: #45735 was ready_for_review by fishpan1209.

see: more, trace.

@RyanTheOptimist

Copy link
Copy Markdown
Contributor

@fishpan1209 this is waiting on an update from you, right?
/wait

…erFactory

Signed-off-by: Ting Pan <panting@google.com>
Signed-off-by: Ting Pan <panting@google.com>
Signed-off-by: Ting Pan <panting@google.com>
Signed-off-by: Ting Pan <panting@google.com>
Signed-off-by: Ting Pan <panting@google.com>
@fishpan1209

Copy link
Copy Markdown
Contributor Author

ready for review again, thank you @wang178c @RyanTheOptimist

@fishpan1209

Copy link
Copy Markdown
Contributor Author

/retest

Signed-off-by: Ting Pan <panting@google.com>
Signed-off-by: Ting Pan <panting@google.com>
Comment thread envoy/network/listener.h

namespace Quic {
class QuicPacketWriterFactory;
} // namespace Quic

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we not use forward declaration?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We need to keep the #ifdef ENVOY_ENABLE_QUIC guards and forward declarations here to support non-QUIC builds. Direct inclusion unconditionally pulls in QUICHE headers that are not available or cause conflicts when QUIC is explicitly disabled.

validation_visitor_, *listener_factory_context_);

if (config.udp_listener_config().has_udp_packet_packet_writer_config()) {
auto* quic_factory_factory =

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

quic_packet_writer_factory_factory

// Network::UdpListenerConfig
Network::ActiveUdpListenerFactory& listenerFactory() override { return *listener_factory_; }
Network::UdpPacketWriterFactory& packetWriterFactory() override { return *writer_factory_; }
#ifdef ENVOY_ENABLE_QUIC

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why guarded by MACRO?

Shouldn't quic_writer_factory_ be null by default?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

same reason above, in non-quic builds, we don't declare Quic::QuicPacketWriterFactoryPtr quic_writer_factory_ because quic::packetWriter is not available

const envoy::config::listener::v3::UdpListenerConfig config_;
Network::ActiveUdpListenerFactoryPtr listener_factory_;
Network::UdpPacketWriterFactoryPtr writer_factory_;
#ifdef ENVOY_ENABLE_QUIC

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The same.

Comment thread test/integration/fake_upstream.h Outdated
bool disable_and_do_not_enable_{};
const bool enable_half_close_;
testing::NiceMock<ProtobufMessage::MockValidationVisitor> validation_visitor_;
#ifdef ENVOY_ENABLE_QUIC

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Revert unrelated-change

quic_dispatcher_->InitializeWithWriter(quic_packet_writer);
udp_packet_writer.release();
// Create quic_packet_writer
QuicPacketWriterFactory* quic_factory =

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

quic_packet_writer_factory

Signed-off-by: Ting Pan <panting@google.com>
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.

3 participants