-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Extend UdpPacketWriter interface for advanced writers #41604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Ting Pan <[email protected]>
Signed-off-by: Ting Pan <[email protected]>
/retest |
/assign @RyanTheOptimist @wang178c |
Stats::Scope& scope) PURE; | ||
virtual UdpPacketWriterPtr | ||
createUdpPacketWriter(Network::IoHandle& io_handle, Stats::Scope& scope, | ||
Envoy::Event::Dispatcher& dispatcher, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add comments for the new parameters (dispacter
is pretty obvious, but on_can_write_cb
is less so)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added comments for new params and updated existing comments because the "socket" param is outdated
listener_config.udpListenerConfig()->packetWriterFactory().createUdpPacketWriter( | ||
listen_socket_.ioHandle(), listener_config.listenerScope()); | ||
listen_socket_.ioHandle(), listener_config.listenerScope(), dispatcher, | ||
std::move(on_can_write_cb)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might have missed it, but do we have a unit test which ensures that this CB is sent correctly to the writer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we don't have a unit test for the cb because this change is interface only, the concrete implementation using the cb will come in followup cl.
Signed-off-by: Ting Pan <[email protected]>
/retest |
//test/integration:load_stats_integration_test failed again, this test is very flaky |
Commit Message: Extend UdpPacketWriterFactory interface for advanced writers
Additional Description:
This change modifies the
UdpPacketWriterFactory
interface to include two new parameters in its creation methods:dispatcher
: to allow writer implementations to schedule file event.on_can_write_cb
: callback that the writer implementation can invoke to signal it's ready to write more data.These additions are necessary to support more complex writer implementations who requires interaction with the dispatcher and a mechanism to signal readiness to send.
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:]