GithubHelp home page GithubHelp logo

cb2's People

Contributors

prognostikos avatar reiz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cb2's Issues

CB2 stays half open forever after being tripped open once

Hi
It looks like CB2 can never become fully closed after being opened once. Here's a failing test.

The rolling window strategy's #half_open? is pretty much the opposite of #open?, which is not what it is supposed to represent.

I was thinking of having a success callback in a strategy, which would reset last_open if the circuit breaker is currently half-open. This would solve the issue in a single-threaded case, although in a hacky manner, but there are going to be issues with concurrent clients (cranking up number of WORKERS in the test to 50 or so exposes the issue).

SocketError: getaddrinfo: Name or service not known

Ok, so I got somewhat weird behaviour regarding the redis connection. Whenever I want to run something inside the breaker block, I get a SocketError (see stack trace below).

Manually creating a redis connection with the same url works fine and allows me to save things to redis...
Comparing the two redis connections tells me that they are the same:

# manual redis
my_redis = Redis.new
my_redis
=> #<Redis client v3.3.1 for redis://<redacted_but_correct_url>.com:6379/0> 
my_redis.set('totally', 'works')
=> "OK"

# cb2 breaker redis
breaker ||= CB2::Breaker.new(
  ...,
  redis: Redis.new
)
breaker
=> <... @redis=#<Redis client v3.3.1 for redis://<redacted_but_correct_url>.com:6379/0>, @last_open=nil>>

Any thoughts? Ideas?

Error output:

SocketError: getaddrinfo: Name or service not known
	from /usr/local/rvm/gems/ruby-2.3.1/gems/redis-3.3.1/lib/redis/connection/ruby.rb:212:in `getaddrinfo'
	from /usr/local/rvm/gems/ruby-2.3.1/gems/redis-3.3.1/lib/redis/connection/ruby.rb:212:in `connect'
	from /usr/local/rvm/gems/ruby-2.3.1/gems/redis-3.3.1/lib/redis/connection/ruby.rb:295:in `connect'
	from /usr/local/rvm/gems/ruby-2.3.1/gems/redis-3.3.1/lib/redis/client.rb:336:in `establish_connection'
	from /usr/local/rvm/gems/ruby-2.3.1/gems/redis-3.3.1/lib/redis/client.rb:101:in `block in connect'
	from /usr/local/rvm/gems/ruby-2.3.1/gems/redis-3.3.1/lib/redis/client.rb:293:in `with_reconnect'
	from /usr/local/rvm/gems/ruby-2.3.1/gems/redis-3.3.1/lib/redis/client.rb:100:in `connect'
	from /usr/local/rvm/gems/ruby-2.3.1/gems/redis-3.3.1/lib/redis/client.rb:364:in `ensure_connected'
	from /usr/local/rvm/gems/ruby-2.3.1/gems/redis-3.3.1/lib/redis/client.rb:221:in `block in process'
	from /usr/local/rvm/gems/ruby-2.3.1/gems/redis-3.3.1/lib/redis/client.rb:306:in `logging'
	from /usr/local/rvm/gems/ruby-2.3.1/gems/redis-3.3.1/lib/redis/client.rb:220:in `process'
	from /usr/local/rvm/gems/ruby-2.3.1/gems/redis-3.3.1/lib/redis/client.rb:120:in `call'
	from /usr/local/rvm/gems/ruby-2.3.1/gems/redis-3.3.1/lib/redis/client.rb:572:in `block in resolve_master'
	from /usr/local/rvm/gems/ruby-2.3.1/gems/redis-3.3.1/lib/redis/client.rb:554:in `block in sentinel_detect'
	from /usr/local/rvm/gems/ruby-2.3.1/gems/redis-3.3.1/lib/redis/client.rb:546:in `each'
	from /usr/local/rvm/gems/ruby-2.3.1/gems/redis-3.3.1/lib/redis/client.rb:546:in `sentinel_detect'
... 22 levels...
	from /usr/local/rvm/gems/ruby-2.3.1@global/gems/bundler-1.12.1/lib/bundler/cli/exec.rb:63:in `load'
	from /usr/local/rvm/gems/ruby-2.3.1@global/gems/bundler-1.12.1/lib/bundler/cli/exec.rb:63:in `kernel_load'
	from /usr/local/rvm/gems/ruby-2.3.1@global/gems/bundler-1.12.1/lib/bundler/cli/exec.rb:24:in `run'
	from /usr/local/rvm/gems/ruby-2.3.1@global/gems/bundler-1.12.1/lib/bundler/cli.rb:304:in `exec'
	from /usr/local/rvm/gems/ruby-2.3.1@global/gems/bundler-1.12.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	from /usr/local/rvm/gems/ruby-2.3.1@global/gems/bundler-1.12.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
	from /usr/local/rvm/gems/ruby-2.3.1@global/gems/bundler-1.12.1/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
	from /usr/local/rvm/gems/ruby-2.3.1@global/gems/bundler-1.12.1/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
	from /usr/local/rvm/gems/ruby-2.3.1@global/gems/bundler-1.12.1/lib/bundler/cli.rb:11:in `start'
	from /usr/local/rvm/gems/ruby-2.3.1@global/gems/bundler-1.12.1/exe/bundle:27:in `block in <top (required)>'
	from /usr/local/rvm/gems/ruby-2.3.1@global/gems/bundler-1.12.1/lib/bundler/friendly_errors.rb:98:in `with_friendly_errors'
	from /usr/local/rvm/gems/ruby-2.3.1@global/gems/bundler-1.12.1/exe/bundle:19:in `<top (required)>'
	from /usr/local/rvm/gems/ruby-2.3.1@global/bin/bundle:23:in `load'
	from /usr/local/rvm/gems/ruby-2.3.1@global/bin/bundle:23:in `<main>'
	from /usr/local/rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `eval'
	from /usr/local/rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `<main>'

actual state of the gem

what is the current state of this gem?
the last commit dates from a year ago...is it still maintained or its just "done"?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.