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

Asynchronous connection initialization in Layer #676

Open
frekw opened this issue Nov 14, 2022 · 4 comments
Open

Asynchronous connection initialization in Layer #676

frekw opened this issue Nov 14, 2022 · 4 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@frekw
Copy link

frekw commented Nov 14, 2022

Hi!

Today the RedisExecutor seems to connect synchronosly when the layer is constructed, which means that my application is unable to start if Redis is currently unavailable. I think it would be preferable if initializing the connection happened asynchronously (or if the user could choose between the two).

@mijicd mijicd added the enhancement New feature or request label Nov 21, 2022
@drmarjanovic
Copy link
Collaborator

@mijicd I would like to pick this up if no one started working on this?

@mijicd
Copy link
Member

mijicd commented Feb 2, 2023

@drmarjanovic all yours

@drmarjanovic
Copy link
Collaborator

Hi!

I've investigated this a little bit and I just want to be sure what is the expected behavior.

Currently, we have the following scenarios:

  1. Redis is unavailable
  2. Start the example app
  3. Nothing happens, the application is closed

and

  1. Redis is available
  2. Start the example app
  3. The application is up and running
  4. Redis becomes unavailable
  5. The application is still running, but queries are going to fail

So, I'm just wondering, do you want a lazy init? Even if Redis is down, do you still want your application up and running and to start failing when Redis is actually invoked?

@frekw @mijicd

@frekw
Copy link
Author

frekw commented Feb 8, 2023

This is the behaviour I would want, which is essentially that of a connection pool (perhaps a job for ZPool?)

  1. Redis is unavailable
  2. My application is able to start
  3. Queries fail
  4. Redis becomes available
  5. Queries work
  6. Redis becomes unavailable
  7. Queries fail
  8. etc

But e.g a common scenario would be that when Redis goes down, application load increases. And if I can't spawn new instances of my application when Redis is down I'm unable to auto scale to meet the load :)

@mijicd mijicd added this to the 0.3.0 milestone Apr 6, 2023
@mijicd mijicd modified the milestones: 0.3.0, 1.1.0 Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants