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

SetPartitionsLostHandler not called on group loss #2389

Open
1 of 8 tasks
alex-zyl opened this issue Dec 25, 2024 · 0 comments
Open
1 of 8 tasks

SetPartitionsLostHandler not called on group loss #2389

alex-zyl opened this issue Dec 25, 2024 · 0 comments

Comments

@alex-zyl
Copy link

alex-zyl commented Dec 25, 2024

Description

SetPartitionsLostHandler and SetPartitionsRevokedHandler handlers are not invoked when consumer loses consumer group due to exceeded poll interval.

How to reproduce

Confluent.Kafka Verion 2.6.1

Consumer setup

var consumer = new ConsumerBuilder<string, string>(new ConsumerConfig
        {
            BootstrapServers = config["Kafka:BootstrapServers"],
            GroupId = "your-group-id",
            AutoOffsetReset = AutoOffsetReset.Earliest,
            MaxPollIntervalMs = 15000,
            SessionTimeoutMs = 10000
        })
                .SetPartitionsLostHandler((consumer, list) =>
                {
                    _logger.LogInformation("Partitions lost");
                })
                .SetErrorHandler((consumer, error) =>
                {
                    _logger.LogInformation(error.Reason);
                })
                .Build();

var message1 = consumer.Consume();

await Task.Delay(Timespan.FromSeconds(30));
// Here, the following warning message is logged 
// [thrd:main]: Application maximum poll interval (15000ms) exceeded by 7ms (adjust max.poll.interval.ms for long-running message processing): leaving group

// Subsequent Consume() raises ConsumeException with ErrorCode.Local_MaxPollExceeded
var message2 = consumer.Consume();

Expected Result

SetPartitionsLostHandler is invoked on partitions ownership loss.

Actual Result

Only SetLogHandler is invoked.

Checklist

Please provide the following information:

  • A complete (i.e. we can run it), minimal program demonstrating the problem. No need to supply a project file.
  • Confluent.Kafka nuget version.
  • Apache Kafka version.
  • Client configuration.
  • Operating system.
  • Provide logs (with "debug" : "..." as necessary in configuration).
  • Provide broker log excerpts.
  • Critical issue.
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

No branches or pull requests

1 participant