Skip to content

Make HotRestart reference available to ActiveQuicListeners - #29306

Closed
ravenblackx wants to merge 12 commits into
envoyproxy:mainfrom
ravenblackx:quic_stat
Closed

ravenblackx wants to merge 12 commits into
envoyproxy:mainfrom
ravenblackx:quic_stat

Conversation

@ravenblackx

Copy link
Copy Markdown
Contributor

Commit Message: Make HotRestart reference available to ActiveQuicListeners
Additional Description: This is a prerequisite for quic hot restart support; listeners must be registered with the hot restart class so that it can find where to send forwarded packets. Adding the hot restart reference to the factory as a new field causes per-cluster memory tests to fail, so it has to be rolled in with an existing reference to avoid that (the alternative would be piping it through as a new parameter through a much longer chain of function calls, which has a relatively large blast-radius and logically makes less sense than delivering it via a factory.)
Risk Level: None - when it builds it's effectively a no-op for now.
Testing: Existing coverage. The hotRestart() getter is not tested until a subsequent change in which it is used.
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: n/a

@ravenblackx

Copy link
Copy Markdown
Contributor Author

Assigning to @jmarantz for first pass due to familiarity with the purpose of this change.

Signed-off-by: Raven Black <[email protected]>
Signed-off-by: Raven Black <[email protected]>
jmarantz
jmarantz previously approved these changes Aug 28, 2023
Comment thread source/common/quic/BUILD Outdated
srcs = ["quic_stat_names.cc"],
hdrs = ["quic_stat_names.h"],
hdrs = [
"quic_context.h",

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.

nit: I think it would be a little nicer to separate quic_context_lib but that would probably add a few BUILD files to the PR. I'm fine with checking this in and iterating, or you can go ahead and do it now; up to you. WDYT for now of at least adding a comment with a TODO?

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.

+1 for me.

@jmarantz

Copy link
Copy Markdown
Contributor

I think Dan &/or Ryan needs to take a look also.

@RyanTheOptimist RyanTheOptimist left a comment

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.

Nice! This looks great.

Comment thread source/common/quic/BUILD Outdated
srcs = ["quic_stat_names.cc"],
hdrs = ["quic_stat_names.h"],
hdrs = [
"quic_context.h",

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.

+1 for me.

} // namespace Server
namespace Quic {

class QuicContext {

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.

nit: Brief comment.

http_context_(stats_store_.symbolTable()), router_context_(stats_store_.symbolTable()),
time_system_(time_system), server_contexts_(*this),
quic_stat_names_(stats_store_.symbolTable()) {
quic_context_(stats_store_.symbolTable(), absl::nullopt) {

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.

I'm slightly surprised that this is a nullopt here. Does this maybe deserve a comment explaining why? I have a couple of hypothesis, but I'm not sure if they're valid :)

@jmarantz jmarantz Aug 29, 2023 •

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.

I can explain why -- the validation-server does not have a hot-restart object. You could arguably instantiate a no-op hot-restarter like we do in server/server.cc if we disable hot-restart, but this seems OK as long as we always check the optional value before dereferencig it.

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.

I can explain why -- the validation-server does not have a hot-restart object.

Ah! That makes sense.

You could arguably instantiate a no-op hot-restarter like we do in server/server.cc if we disable hot-restart, but this seems OK as long as we always check the optional value before dereferencig it.

nod that makes sense. Though if we do have a no-op restarter, I would probably be inclined to use it here so we can avoid the need to do the checks elsewhere. But this current approach is also just fine.

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.

I went with OptRef rather than the no-op object because getting the no-op one into all the various test contexts where the object is referenced would be way more of a pain than the one-line "is it set" check at the single usage site. I agree with the design preference of using the no-op object, but from a practical perspective doing it that way is a lot. (And the usage site isn't in any main flow so it's not performance-critical enough to warrant that effort.)

@RyanTheOptimist

Copy link
Copy Markdown
Contributor

/wait

Signed-off-by: Raven Black <[email protected]>
@ravenblackx

Copy link
Copy Markdown
Contributor Author

Now it looks like this might not be necessary after all, as progress happens on its dependent...

@jmarantz

Copy link
Copy Markdown
Contributor

Not following you -- are you going to close this PR and re-open if needed then?

@ravenblackx

Copy link
Copy Markdown
Contributor Author

Ah, good point, I forgot re-open was even an option. Yes, I'm now about 90% confident that this is not necessary, so closing it, at least for now, hopefully forever. 😁

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.

4 participants