Skip to content
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

CORE-2056: net: allow conn_quota logger to be configured #17678

Merged
merged 3 commits into from
Apr 5, 2024

Conversation

dotnwat
Copy link
Member

@dotnwat dotnwat commented Apr 5, 2024

net: allow conn_quota logger to be configured

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v23.3.x
  • v23.2.x

Release Notes

  • none

Fixes: CORE-2056

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
@dotnwat dotnwat changed the title net: allow conn_quota logger to be configured CORE-2056: net: allow conn_quota logger to be configured Apr 5, 2024
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
Copy link
Contributor

@WillemKauf WillemKauf left a comment

Choose a reason for hiding this comment

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

lgtm

conn_quota::conn_quota(conn_quota::config_fn cfg_f) noexcept
: _cfg(cfg_f()) {
conn_quota::conn_quota(
conn_quota::config_fn cfg_f, seastar::logger* log) noexcept
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: here and elsewhere, use ss:: namespace (ss::logger) instead of seastar::.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@@ -238,6 +236,7 @@ class conn_quota : public ss::peering_sharded_service<conn_quota> {
conn_quota_config _cfg;

ss::gate _gate;
seastar::logger* _log;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: If _log is non-nullable and won't be reseated, prefer a reference over a pointer.

Copy link
Member Author

Choose a reason for hiding this comment

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

clang-tidy really doesn't like member references. they are a bit weird. wdyt @rockwotj is there a non-null thingy in abseil for this?

Copy link
Contributor

Choose a reason for hiding this comment

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

I personally prefer pointers for a few reasons I can elaborate on, but yes, absl has helpers but we have to update absl: https://github.com/abseil/abseil-cpp/blob/master/absl/base/nullability.h

Copy link
Member Author

Choose a reason for hiding this comment

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

I personally prefer pointers for a few reasons I can elaborate on

Same, but it's more of a vibe. So I'm curious about your throughts. Maybe we should update the coding-style.md with some reasoning?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'll open a thread in #cpplang

Copy link
Contributor

@rockwotj rockwotj left a comment

Choose a reason for hiding this comment

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

LGTM

@vbotbuildovich
Copy link
Collaborator

@dotnwat dotnwat merged commit 359e6d9 into redpanda-data:dev Apr 5, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants