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-2144] schema_registry/protobuf: Disable protobuf logging #22633

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/v/redpanda/application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
#include <seastar/util/defer.hh>
#include <seastar/util/log.hh>

#include <google/protobuf/stubs/logging.h>
#include <sys/resource.h>
#include <sys/utsname.h>

Expand Down Expand Up @@ -525,6 +526,12 @@ void application::initialize(
.get();
_cpu_profiler.invoke_on_all(&resources::cpu_profiler::start).get();

/*
* Disable the logger for protobuf; some interfaces don't allow a pluggable
* error collector.
*/
google::protobuf::SetLogHandler(nullptr);

Comment on lines +529 to +534
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess this is fine... is there any information we'll lose by setting this to nullptr?

Copy link
Member Author

@BenPope BenPope Jul 30, 2024

Choose a reason for hiding this comment

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

I guess this is fine... is there any information we'll lose by setting this to nullptr?

Ideally the interface would take an error collector, such as:

But in this case, not. The only interface that I'm using that doesn't have a collector is the one that produces the this spurious log, which is nearly always wrong, since if it can't decode as plain text, it attempts to decode as proto encoded proto, which is highly likely to succeed. In any case, we are not interested in the information in the log.

I added @jcipar as they also have been using protobuf.

/*
* allocate per-core zstd decompression workspace and per-core
* async_stream_zstd workspaces. it can be several megabytes in size, so do
Expand Down
Loading