Skip to content

storeMessageOffset: ignore state error #129

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
Changes from all commits
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
8 changes: 8 additions & 0 deletions Sources/Kafka/RDKafka/RDKafkaClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,14 @@ final class RDKafkaClient: Sendable {
}

if error != RD_KAFKA_RESP_ERR_NO_ERROR {
// Ignore RD_KAFKA_RESP_ERR__STATE error.
// RD_KAFKA_RESP_ERR__STATE indicates an attempt to commit to an unassigned partition,
// which can occur during rebalancing or when the consumer is shutting down.
// See "Upgrade considerations" for more details: https://github.com/confluentinc/librdkafka/releases/tag/v1.9.0
// Since Kafka Consumers are designed for at-least-once processing, failing to commit here is acceptable.
if error != RD_KAFKA_RESP_ERR__STATE {
return
}
throw KafkaError.rdKafkaError(wrapping: error)
}
}
Expand Down