question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to close circuit in run-time?

See original GitHub issue

We are using resilience4j for sending messages to AMQP broker. Situation that we encountered is that one circuit was open, and since we stopped sending messages for this circuit, it stayed open forever in production. This created problem for alerting, since there is now constantly 1 open circuit forever, and it will not close, since there will be no more messages passing through it.

Is it possible to manually close circuit after some period of inactivity?

Can this be solved with enableAutomaticTransitionFromOpenToHalfOpen:

return CircuitBreakerConfig.custom()
				.failureRateThreshold(50)
				.ringBufferSizeInClosedState(6)
				.ringBufferSizeInHalfOpenState(2)
				.waitDurationInOpenState(Duration.ofMinutes(1))
				.enableAutomaticTransitionFromOpenToHalfOpen()
				.build();

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
RobWincommented, Feb 25, 2019

Hi,

thanks for using Resilience4j, Yes, you can close a circuit breaker “manually” by using circuitbreaker.transitionToClosedState() But you have two other options

  1. Enable automatic transition from OPEN to HALF_OPEN state once the waitDurationInOpenState has passed. --> circuitbreakerConfig.enableAutomaticTransitionFromOpenToHalfOpen()
  2. Create a health check indicator which sends a message in a certain interval in order to check the healthiness of the backend system.
0reactions
kkalaiselvancommented, Jan 8, 2021

Yes, there is an actuator endpoint /acutator/circuitbreakers/<circuitBreakerName> which you can use to update the state to CLOSE, FORCE_OPEN, DISABLE, but not open 😦

You can post a request with the following body

{
    "updateState": "FORCE_OPEN"
}

Thanks @RobWin , that’s what I was looking for. Can you share me the link or doc where i can refer for further information?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resilience4j | Circuit breaker basics & runtime behavior/state ...
If success then close circuit back i.e. allow calls or again open it & wait 60 seconds. Create mock service which returns success...
Read more >
DAG pass to determine circuit runtime · Issue #3092 - GitHub
It should be possible to compute the run time of a circuit at the end of the transpilation process given the gate timing...
Read more >
spring - Hystrix runtime management - Stack Overflow
You can set the property hystrix.command.HystrixCommandKey.circuitBreaker.forceClosed. ConfigurationManager.getConfigInstance().
Read more >
Runtime Capabilities - Tremor
It is possible for any operator node in a pipeline and for all connectors to open and close the runtimes builtin circuit breaker...
Read more >
Estimating the Circuit De-obfuscation Runtime based on ...
The proposed ICNet is an end-to-end framework that can automatically extract the deter-minant features required for deobfuscation runtime prediction.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found