circuit breaker - Can my policy behavior change based on data in the execute?

I am using the Circuit Breaker Policy for database access. I have a multi-tenant structure with identical databases that store data for different clients. My application could hit any of the tenants. If one database is down the others may not be. If I open the breaker I want to only open it for that tenant. I created identical polices for each tenant and store them in a Dictionary with the tenant name as the key. When making a database call, I retrieve the matching policy from the dictionary and execute it.I am fairly sure this works but ...Read more

Polly Circuit Breaker / Retry to automatically restart queries after a network outage

I am implementing the Circuit Breaker and Retry patterns via Polly in .NET framework 4.5.2.I wish to see if my understanding is correct. Question 1: If there is a network outage and the circuit breaker has reached the exceptionsAllowedBeforeBreaking number, gone into the open state and waited for the durationOfBreak period, the circuit will be open for new requests but those that have been sent will throw an exception?Question 2: If the desired behavior is for those requests that had exceptions to be retried instead of the circuit breaker thro...Read more

circuit breaker - Registering failed attempt inside checked function seems to be counted double

I'm exploring resilience4j and would like to both be able to record a failure for a circuit breaker inside a checked function, as well as returning a meaningful result. But the failure seems to be counted double when I do. I'm using version 0.13.1:<dependency> <groupId>io.github.resilience4j</groupId> <artifactId>resilience4j-circuitbreaker</artifactId> <version>0.13.1</version></dependency>Check the following test, we have a closed ring buffer of 10 which indicates that 10 calls should b...Read more

envoyproxy - Circuit Breaker envoy proxy

I am going to setup an envoy proxy, but still confused about the Circuit Breaker. For example: max_connections (UInt32Value) is the maximum number of connections that Envoy will make to the upstream cluster. If not specified, the default is 1024.Does that mean it will limit max_connections per hosts in cluster or limit max_connections per cluster?Thank you in advance....Read more

circuit breaker - Polly and wrapped policies

Im new to Polly and is trying to create a circuit breaker with fallback and timeout policy. My setup looks like below where all policies are "global" so they keep state between calls:_timeoutPolicy = Policy.Timeout(TimeSpan.FromMilliseconds(1500),TimeoutStrategy.Pessimistic);_circuitBreaker = Policy.Handle<Exception>() .AdvancedCircuitBreaker( failureThreshold:0.5, samplingDuration: TimeSpan.FromSeconds(20), minimumThroughput: 5, ...Read more

circuit breaker - Access to wrapped Polly policy

If I wrap some polices is it possible to acces them from the wrapped policy?example:var handle = Policy.Handle<Exception>();//.OrResult<HttpResponseMessage>(r => r.IsSuccessStatusCode == false);var timeout = Policy.TimeoutAsync(() => TimeSpan.FromMinutes(5) /*loginConnectorOptions.Timeout*/);var retry = handle.RetryAsync(retryCount: 3);var cb = handle.CircuitBreakerAsync(exceptionsAllowedBeforeBreaking: 3, durationOfBreak: TimeSpan.FromMinutes(3));var bulkhead = Policy.BulkheadAsync(maxParallelization: 4, maxQueuingActions: 2...Read more

circuit breaker - Should the ground lug be bonded in my sub-panel?

I have 200 amp service at the house. I want to install a DP 60 amp breaker in that panel and run # 6 wire approximately 150 feet (10% added for swag) overhead to a dog rescue building. The building will have a window AC installed (7.8A@208V), plus a number of 20" box fans (0.8A each) , and LED lighting for a 480 square foot building. The AC unit is the only thing pulling a significant amount of power. It is my understanding that the grounds and the neutrals need to be separated. Does that mean I should not install the bonding screw which I...Read more

subpanel - Wiring a sub-panel with an equal sized breaker on each end of the feed, which will trip first?

I'm wiring up a small backyard tiny house for use as a rental.  Main power will be supplied by a 30A breaker and 10/2 wire coming from the main house, to an RV box, then to an RV plug, then into the sub panel in the tiny house where it feeds a couple of 20A circuits.So heres the issue, with this amount of power, popping the breaker will happen from time to time, and I want the person in the house to be able to reset it there. (I can't be the first person to have this issue with sub panels)If I didn't care about electrical code, I'd just go ahea...Read more

circuit breaker - What is considered "servicing" for NEC 225.30?

I previously asked a question (Grounding subpanels located ~100ft from main breaker) where I was informed of NEC 225.30, which states that a building [...] shall be supplied by only one feeder or branch circuit [...]It sounds like this code exists to ensure that each building has a single breaker or disconnect method that disconnects the entire building.How does this relate to a building which has a main breaker panel that feeds multiple subpanels? For example, if I have a 200A main panel with two 100A breakers, each feeding a 125A subpanel (...Read more

circuit breaker - How should I add an AFCI to this panel?

I'd like to add an AFCI to the middle circuit here. But that circuit shares a tandem breaker with the circuit above it, so I don't know if there are any subtleties of this setup that I don't understand. They don't appear to be a multi-wire branch circuit--they have separate neutrals going to the neutral bar. Can I just move the middle circuit to a new slot?...Read more

subpanel - Circuit breaker panel voltage drops when a load is added

I have a 240 volt 225 amp sub-panel. Both lines attached to the bus bar have 120v. When I turn on any breaker connected to one of the bus bars, the voltage drops to 80-108v. If I remove the load and then turn on the breaker, I have 120v.All breakers on the other bus bar when turned on do not affect the voltage. It remains at 120v.Any idea what the issue is, as it doesn't seem to be the wire, the panel or the breakers....Read more

electrical panel - What are good uses for tandem (double-stuff) breakers?

Pretty much all of the advice regarding panels here revolves around the idea of heavily oversizing your breaker panel to avoid running out of spaces and to avoid needing tandem breakers. Especially given new AFCI requirements for pretty much everything except dedicated loads, it seems like tandem breakers are decreasingly useful.Are there any particularly good applications for tandem (or double-stuff) breakers, including triplex and quad breakers?As an example, I have a solar setup backfeeding a 20A 2-pole breaker. I also have a solar productio...Read more

circuit breaker - Is this a correct installation of a whole house Surge Protector?

Is this a correct installation of a whole house Surge Protector?Note that it's not closest to the main lugs, will that matter?I was unable to bring it closer to the main lugs since those had special breakers which I did not have and I did not want to mess with that wiring.I have installed the Square D 80 whole house surge protector at the first available breaker that wasn't GFI. It's a brand new breaker rated at 30 A. I could not find a 20 A breaker at Lowe's so I opted for the next one up.Should I have used a 20A?Notice that one of the neutral...Read more