-
Notifications
You must be signed in to change notification settings - Fork 108
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: semaphore added #72
Conversation
Also using blue-tape to fix a specific test and Connects to #60
as property
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some questions about this that I think we need to figure out the answers to, and possibly have tests for.
- Does it make sense to always use execution isolation with semaphores? What if there's not really a need for it? Why have it be always on? Reading the Netflix documentation here https://github.com/Netflix/Hystrix/wiki/How-it-Works#semaphores it really only makes sense to use semaphore isolation in certain use cases where the latency is very low and throughput requirements very high. Given that, we have no real way of implementing thread pool isolation/rate limiting, so maybe it does make sense to have it always on. I'm not 100% sure, but I think we should discuss it.
- What happens to the semaphore when a circuit fires, but then times out? Is it released? We need to know that it is.
- What happens when the semaphore has reached its limit and
semaphore.acquire()
is called? Does it return a rejected promise? Immediately? Or something else? We should test for this. - The docs should be updated.
Indeed, also I need to research more about it.
Good question, I'm going to investigate it.
Agree.
yup |
seems like It is not releasing
update: yes it is released semaphore.acquire() and calling release(); |
@lanceball: not release when CB timeout is a blocker right ? Also, I'm going try to change sem.use() to sem.aquire() and try to call the release() in some place around that timeout code |
I'm doing another test, but I missed to add more |
So after change the code , and adding the I will send the test code because I may be testing the wrong way. So it's good to have a new view on this part |
Now I'm using this lib to run the code in parallel : interesting because the code "runs" without error. |
@lance when running in parallel we have this :
|
Also new devDependency added run-parallel: 1.1.6
true, with the current code we can see some real changes only when we run the code in parallel. |
Also removed two of the existing semaphore tests that were not really automated tests, but rather some debugging information about how the semaphore rate limiting works.
Replacing 'await-semaphore' since we need the `test()` function and there does not appear to be a widely used/maintained semaphore implementation that provides it and doesn't also depend on the `async/await` keywords at runtime.
Until we can figure out what's going on with node-gyp and 8.1.2.
Also using blue-tape to fix a specific test and
Connects to #60