Skip to content

Conversation

@jcleezer
Copy link
Contributor

@jcleezer jcleezer commented Oct 15, 2025

Exceptions can lead to a large amount of logs so use a rate limited logger.

catch (RuntimeException | PartitionAccessException | ServiceUnavailableException e)
{
_log.error("Cannot find partition id for request: {}, defaulting to 0", request.getURI(), e);
_rateLimitedLogger.error("Cannot find partition id for request: {}, defaulting to 0", request.getURI(), e);
Copy link
Contributor

Choose a reason for hiding this comment

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

It's possible that if there are many logs of one of these two types, only one of them will be ever seen. To avoid this, two rate limited logger instances need to be created.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to use two loggers.

Copy link
Contributor

@shivamgupta1 shivamgupta1 left a comment

Choose a reason for hiding this comment

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

LGTM

@shivamgupta1 shivamgupta1 merged commit c4bed3d into linkedin:master Oct 15, 2025
2 checks passed
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.

2 participants