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

Handle initial connection failure #36

Open
SukhikhN opened this issue Oct 6, 2022 · 1 comment
Open

Handle initial connection failure #36

SukhikhN opened this issue Oct 6, 2022 · 1 comment

Comments

@SukhikhN
Copy link

SukhikhN commented Oct 6, 2022

I start wolff producers during the app initialization with wolff:ensure_supervised_producers/3, but it fails if my kafka server is unavailable. I need to start them anyway so they will queue messages via replayq and replay the messages when connection will be established, just like when connection to kafka lost after app start.

Is there any way to achieve this with wolff?

I see that in previous versions producers were kept running after initial connection failure, but this commit e45b4ed changed this behavior, and I don't fully understand why.

@zmstone
Copy link
Contributor

zmstone commented Aug 2, 2023

Hi @SukhikhN
The challenge might be, if Kafka is not available, there is no way to know the number of partitions etc. So it cannot start the producers.
The commit e45b4ed made the deletion of the producers if failed to initialize, before this commit, the producers process will keep waiting for the initialization to complete and then hopefully start working when Kafka is back. However the old behavior does not solve your problem either, because replayq would not be ready until Kafka is back, and the producers to get initialized.

To make it more resilient to Kafka failures, we would need to detach replayq buffer from the producer processes (not depend on the number of partitions etc), which seem to be quite a big refactoring.

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

2 participants