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

Conversation

BenPope
Copy link
Member

@BenPope BenPope commented Jul 29, 2024

Fixes #17682

Notes to reviewer

There are a few (not necessarily orthogonal) options here:

  • Set the sink to nullptr
  • Set the log_level
  • Make the log_level configurable
  • Implement a new Sink.

I went with the simplest. Some of the options are not thread-safe.

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
  • v24.2.x
  • v24.1.x
  • v23.3.x

Release Notes

Improvements

  • Schema Registry: Remove spurious log entry: No syntax specified for the proto file

BenPope added 2 commits July 29, 2024 18:46
This is a regression introduced in redpanda-data@e7fab4a

Signed-off-by: Ben Pope <ben@redpanda.com>
Fixes CORE-2144

Signed-off-by: Ben Pope <ben@redpanda.com>
@BenPope BenPope added the area/schema-registry Schema Registry service within Redpanda label Jul 29, 2024
@BenPope BenPope requested a review from a team July 29, 2024 17:48
@BenPope BenPope self-assigned this Jul 29, 2024
@BenPope BenPope requested review from michael-redpanda and removed request for a team July 29, 2024 17:48
@BenPope BenPope requested review from andijcr and jcipar July 29, 2024 17:48
Comment on lines +529 to +534
/*
* Disable the logger for protobuf; some interfaces don't allow a pluggable
* error collector.
*/
google::protobuf::SetLogHandler(nullptr);

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.

@BenPope BenPope merged commit 777891f into redpanda-data:dev Jul 30, 2024
22 checks passed
@vbotbuildovich
Copy link
Collaborator

/backport v24.2.x

@vbotbuildovich
Copy link
Collaborator

/backport v24.1.x

@vbotbuildovich
Copy link
Collaborator

/backport v23.3.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/redpanda area/schema-registry Schema Registry service within Redpanda
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No syntax specified for the proto file Warning
4 participants