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

Abort controller is controlling at the breaker level, not for each run #780

Closed
fuliisrobin opened this issue Jun 20, 2023 · 3 comments
Closed

Comments

@fuliisrobin
Copy link

fuliisrobin commented Jun 20, 2023

Node.js Version:

19.6.0

Operating System:

Linux PowerHorse 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Steps to Produce Error:

Hi, this is really a good library to implement nodejs layer circuit breaker! It supports most of our circuit breaker requirements, however, when we're dealing with timeouts, the current design of circuit breaker can only control the abortController at the breaker level, which means, when there is one timeout happens, all the running tasks fired by this breaker will be aborted.

Is this intentionally designed like this or am I missing anything? I'm able to overcome this by using AsyncLocalStorage, however, that solution looks like a bit tricky.

@lance
Copy link
Member

lance commented Jun 29, 2023

Hi @fuliisrobin. Thanks for your kind words about the module! Yes, the intent is that when a circuit times out, an assumption is made that all other ongoing requests to the same endpoint will time out as well. Otherwise, I believe that an abortController would need to be provided for each call to circuit.fire(). I understand this may not be ideal for your scenario, and I'm curious what you are doing with AsyncLocalStorage to address the situation.

@github-actions
Copy link
Contributor

This issue is stale because it has been open 30 days with no activity.

@lholmquist
Copy link
Member

Closing due to no response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants