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

KafkaConsumer: store offsets when .finishing #121

Conversation

felixschlegel
Copy link
Contributor

@felixschlegel felixschlegel commented Aug 23, 2023

Motivation:

This PR addresses issue #119.

The KafkaConsumer should not fatalError when storing offsets in
state .finishing.

See #119 (comment) for more information why.

Modifications:

  • terminate KafkaConsumerMessages sequences when in state .finishing
    or .finished instead of storing offsets

@FranzBusch FranzBusch enabled auto-merge (squash) August 23, 2023 10:26
@FranzBusch FranzBusch disabled auto-merge August 23, 2023 10:26
@@ -585,7 +585,9 @@ extension KafkaConsumer {
fatalError("Cannot store offset when consumption has been stopped")
case .consuming(let client, _):
return .storeOffset(client: client)
case .finishing, .finished:
case .finishing(let client):
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we have a test for this actually

Motivation:

This PR addresses issue swift-server#119.

The `KafkaConsumer` should not `fatalError` when storing offsets in
state `.finishing`.

See swift-server#119 (comment) for more information why.

Modifications:

* terminate `KafkaConsumerMessages` sequences when in state `.finishing`
  or `.finished` instead of storing offsets
@felixschlegel felixschlegel force-pushed the fs-kafka-consumer-store-offset-when-finishing branch from 13eb697 to 604f25c Compare August 23, 2023 14:20
@felixschlegel
Copy link
Contributor Author

Please merge @FranzBusch

@FranzBusch FranzBusch merged commit 838ebb3 into swift-server:main Aug 24, 2023
@FranzBusch FranzBusch deleted the fs-kafka-consumer-store-offset-when-finishing branch September 4, 2023 09:15
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