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

feat: add batch reading for Jetstream #1678

Closed
wants to merge 1 commit into from

Conversation

kohlisid
Copy link
Contributor

Fixes #1675

Signed-off-by: Sidhant Kohli <sidhant.kohli@gmail.com>
Comment on lines +136 to +138
if err = msgs.Error(); err != nil {
return nil, err
}
Copy link
Contributor

Choose a reason for hiding this comment

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

we cannot do this; we will have to return partial read messages, or else it is a data loss scenario. Perhaps you can return err at the end.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can return the partial messages read along with the error.

Though one question, in case we return no messages, they won't be acked by us as well right? And ideally the whole batch should be retried in the next read?

for _, msg := range msgs {

// Wait until the batch processing is done
<-msgs.Done()
Copy link
Member

Choose a reason for hiding this comment

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

Be very cautious on this async fetch call, I don't trust the reliability based on our past experience.

Copy link
Contributor

Choose a reason for hiding this comment

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

@kohlisid, can you check whether it uses Fetch behind the scenes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does not use Fetch call directly. Both of them have different ways of collating and reporting the data.
@whynowy Any specific areas that we can verify to ensure the scenarios you are mentioning?

@vigith vigith changed the title feath: add batch reading for Jetstream feat: add batch reading for Jetstream Apr 16, 2024
@vigith
Copy link
Contributor

vigith commented May 2, 2024

what's the plan for this PR?

@kohlisid
Copy link
Contributor Author

kohlisid commented May 3, 2024

@vigith I was thinking to get this done along with the new Jetstream API changes. With the changes in functionality from their side regarding the same.

@vigith
Copy link
Contributor

vigith commented May 3, 2024

@vigith I was thinking to get this done along with the new Jetstream API changes. With the changes in functionality from their side regarding the same.

close this PR then?

@vigith vigith closed this May 4, 2024
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.

Batching with Timeout not working as expected
3 participants