Skip to content

Add consumer seek failure log #24639

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

Merged
merged 3 commits into from
May 19, 2025
Merged

Conversation

shubhi1092
Copy link
Contributor

Description

  • Added an error log when consumer.seek() fails.
  • Added a check to ensure that the circuit breaker metric is not completed before completing it.

@Copilot Copilot AI review requested due to automatic review settings May 15, 2025 21:11
@github-actions github-actions bot added area: server Server related issues (routerlicious) base: main PRs targeted against main branch labels May 15, 2025
@shubhi1092 shubhi1092 changed the title Shuagarwal/circuit breaker pause logs Add consumer seek failure log May 15, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances error handling and metric safety by adding detailed logging for failed Kafka seek operations and guarding against double-completing a circuit breaker metric.

  • Add a Lumberjack error log when consumer.seek() fails
  • Check isCompleted() before completing the circuit breaker metric

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
services-ordering-rdkafka/src/rdkafkaConsumer.ts Log detailed context on consumer.seek() failures
lambdas/src/utils/circuitBreaker.ts Prevent completing an already completed circuit breaker metric
Comments suppressed due to low confidence (2)

server/routerlicious/packages/services-ordering-rdkafka/src/rdkafkaConsumer.ts:585

  • Add a unit or integration test that simulates a consumer.seek() error and verifies that Lumberjack.error is called with the expected properties.
Lumberjack.error(

server/routerlicious/packages/lambdas/src/utils/circuitBreaker.ts:112

  • Add tests covering the scenario where circuitBreakerMetric is already completed to ensure the else branch doesn’t call success again and behaves as expected.
if (this.circuitBreakerMetric && !this.circuitBreakerMetric.isCompleted()) {

@shubhi1092 shubhi1092 merged commit db304a5 into main May 19, 2025
28 checks passed
@shubhi1092 shubhi1092 deleted the shuagarwal/circuitBreaker-pause-logs branch May 19, 2025 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: server Server related issues (routerlicious) base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants