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

HystrixCircuitBreaker allowRequest() doesn't have idempotent behaviour in latest release 1.5.18 #1946

Open
rohansuri opened this issue May 4, 2019 · 2 comments

Comments

@rohansuri
Copy link

rohansuri commented May 4, 2019

The master includes this change PR #1568, which made allowRequest() idempotent, which was released in 1.5.12. However the latest release 1.5.18 doesn't have it.

Does anyone know why?

Thanks

@rohansuri rohansuri changed the title HystrixCircuitBreaker allowRequests() doesn't have idempotent behaviour in latest release HystrixCircuitBreaker allowRequests() doesn't have idempotent behaviour in latest release 1.5.18 May 4, 2019
@rohansuri rohansuri changed the title HystrixCircuitBreaker allowRequests() doesn't have idempotent behaviour in latest release 1.5.18 HystrixCircuitBreaker allowRequest() doesn't have idempotent behaviour in latest release 1.5.18 May 4, 2019
@didi-moritz
Copy link

1.5.11 was re-released as 1.5.18. See #1891 for explanation.

@l2dy
Copy link

l2dy commented Jan 27, 2023

The change might have fixed a race condition in HystrixCommandMetrics that could introduce memory leaks.

resetStream() may be called in parallel with isOpen() or allowRequest(), occasionally leaking subscriptions with re-subscription of counterSubject in BucketedCounterStream.startCachingStreamValuesIfUnstarted().

/* package */ synchronized void resetStream() {
healthCountsStream.unsubscribe();
HealthCountsStream.removeByKey(key);
healthCountsStream = HealthCountsStream.getInstance(key, properties);
}

public void startCachingStreamValuesIfUnstarted() {
if (subscription.get() == null) {
//the stream is not yet started
Subscription candidateSubscription = observe().subscribe(counterSubject);
if (subscription.compareAndSet(null, candidateSubscription)) {
//won the race to set the subscription
} else {
//lost the race to set the subscription, so we need to cancel this one
candidateSubscription.unsubscribe();
}
}
}

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

3 participants