- Clear the re-entrancy guard instead of restoring its previous value
- Document that an adapter instance represents one resource
- Make sure PG adapter correctly handles PG::ConnectionBad errors. rails/rails@e61b5e24 rescues these and converts them to ActiveRecord::ConnectionNotEstablished, but that is only on edge. Now that we are also testing on 8.1 it exposed that we are not handling the 8.1 behaviour which is to raise a PG::ConnectionBad.
- Improve testing matrix for this gem.
- Execute_intent no longe raises errors. We need to check the error stored on the query intent and raise it to trip the circuit breaker, then rescue and allow Rails to continue execution.
- Bump rails to latest for testing
- Fix Semian resource allocator pairing
- pin github actions to SHAs
- remove accidentally added @name variable in PIDControllerThread (#1039)
- Add adaptive circuit breaker (experimental feature), and a dual circuit breaker to allow switching between it and classic circuit breaker (#760)
- Pass scope/adapter to notification (#1035)
- Add exponential_backoff_error_timeout feature (#861)
- Use API-based commits for verification (#1002)
- Add
semian/activerecord_postgresql_adapterfor Active Record's PostgreSQL adapter (#889) - Add
open_circuit_on_oomoption for Redis adapters to control whether OOM errors open the circuit breaker (defaults totruefor backward compatibility) (#940) - Support Active Record 8.2's
QueryIntentAPI in trilogy adapter (#904)
- Remove force_config_validation spammy log
- Made
consumersandresourcesfields private in Semian (#795)
- Fixed thread safety issues (#566)
- Added experimental resource for experimentation
- Remove redundant semian resource name from OpenCircuitError and ResourceBusyError
- Fix unbound growth of consumers WeakRef Array
- Add semian resource name to semian exception logs
- Stop bulkhead config validation if sysv_semaphores are not enabled
- Fix log level for initial boot-up message for configuration validation to info, and modify message for correctness.
- Feature: Add logging for invalid configurations, and raise an exception if
force_config_validationis set totrue(#646)
- Feature: Add
lumping_intervaloption that allows lumping errors within a timeframe as a single error (#606)
- Change: Attempt acquiring semaphore before releasing GVL (#573)
- Support only Ruby 3.2 and onward (572)
- Change: Enable thread_safety rubocop
- Change: Freeze constants and remove unused accessor (
@exceptions) fromSemian::GRPC
- Change: semians will trigger on ER_PROXYSQL_MAX_CONN_TIMEOUT with mysql2 (#522)
- Change: added support for dynamic semian_configurations to the Semian Redis adapter
- New:
Semian.disable_bulkheads_for_threaddisables bulkheads for the given thread
- Fix: Trilogy ActiveRecord adapter to be compatible with latest Rails edge.
- Change: Trilogy ActiveRecord adapter will not bypass "SAVEPOINT RELEASE" unless it uses the ActiveRecord default name and only 2 levels of nesting
- Change: The bypass for COMMIT/ROLLBACK statements assumes current ActiveRecord behaviour, that is no blank spaces or ";" chracter at the end of the statement
- Fix valid_raw_connection check
- Fixed compatibility with redis-rb 5.0.7+
- More efficient activerecord_trilogy_adapter and mysql2_adapter regex. (#508, #510)
- Ensure Active Record Trilogy adapter handles AdapterTimeout and ConnectionFailed exceptions. (#497)
- Allow passing --with-openssl-dir for a custom OpenSSL installation. (#499)
- Use ActiveRecord::ConnectionNotEstablished as base error for TrilogyAdapter. (#496)
- Fix Mysql2 connection error regular expressions. (#506)
- Active Record Trilogy adapter needs to patch
#raw_executeinstead of#executefor queries. (#494)
- Redis Readonly errors won't trigger semian open circuit. (#489)
- New
dynamicoptions, allowing a per-request resource configuration with the HTTP adapter. (#485)
- Remove dependency on activerecord-trilogy-adapter in Trilogy adapter for Semian. (#486)
- Fix: Change in method signature for Trilogy adapter's
#execute_method. (#491)
- Support Active Record Trilogy adapter. (#468)
- Avoid prepending the same prefix twice to errors messages. (#423)
This mostly happens with the
redis-rb 5+gem as it translateredis-clienterrors. - Fix running tests in DEBUG mode to test missing semaphores resources. (#430)
Semian.registerreturnsUnprotectedResourcewhen environment variableSEMIAN_DISABLEDis set. (#427) Introduces environment variablesSEMIAN_CIRCUIT_BREAKER_DISABLEDto disable onlycircuit_breakerandSEMIAN_BULKHEAD_DISABLEDonlybulkhead.- Refactor: Replace
Time.nowwithCLOCK_MONOTONICin Resourceupdated_atfield. (#443) ReplaceTimecop.travelfor tests with custom mock solution to support monotonic clocks. - Refactor: Replace
Time.nowwithCLOCK_MONOTONICinCircuitBreaker. (#441) - Support Ruby 3.2.0. (#463)
- Enable write barrier protection on Resource. (#469)
- Typo in error message for missing option
:tickets. (#412) - Add process id in DEBUG message for bulkheading/resource. (#416)
- Feature: Add ability to turn off window based circuit eviction (#418)
- Pinging a closed connection shouldn't be considered a failure. (#396)
- Fix: Patch
new_clientfor Rails apps so that the OpenCircuitError makes it through. (#395)
- Compatible with Redis 5 (#388, #392)
- Add a warning message about redis 5.x. (#386)
- Fix: Update AbstractAdapter patch to accomodate recent Rails changes. (#364)
- Fix: Raise
Redis::OutOfMemoryErrorfor messages that matchOOM command not allowed when used memory > 'maxmemory'rather than checkingstart_with?("OOM "). (#367)
- Refactor: Replace Time.now with CLOCK_MONOTONIC in MockServer (#318)
- Fix: Circuit not open for GRPC::ActiveCall::Operation failures (#348)
- Feature: Add support for the
redis-clientgem (#314)
- Feature: Add error_threshold_timeout configuration parameter (#299)
- Fix: ECONNRESET won't trigger circuit open for redis (#306)
- Fix: pass disable flag by patching new singleton method (#303)
- Feature: Add disable flag to http adapter (#301)
- Fix: Add
externto global variable declarations for gcc 10 (#288)
- Feature: Log last error message on circuit breaker state transition (#285)
- Fix: Update README and docs to resolve common misconception about error_threshold (#283)
- Fix: Remove
MySQL client is not connectederror from mysql2 adapter
- Feature: Add
Semian.namespaceto globally prefix all the semaphore names. (#280)
- Feature: Add
Semian.default_permissionsto globally change the default semaphore permissions. (#279)
- Fix: Match whitelisted SQL queries when Marginalia is prepended (#276)
- Fix: Compatibility with GC.compact
- Fix: Revert the changes in v0.10.3. (#270)
- Fix: Positional/Keyword arguments deprecations warning for Ruby 2.7 in the grpc adapter. (#269)
- Fix: Positional/Keyword arguments deprecations warning for Ruby 2.7.
- Fix: thread safety bug on Ruby 2.7. (#263)
- Feature: Support half open resource timeout for redis.
- Fix: Compatibility with MRI 2.3
- Feature: Add a LRU to garbage collect old resources. (#193)
- Fix: Recursion issue in MySQL2 adapter causing circuits breakers to stay open much longer than they should. (#250)
- Fix: Better handle DNS resolutions exceptions in Redis adapter. (#230)
- Feature: Introduce the GRPC adapter (#200)
- Fix: Instrument success for
acquire_circuit_breaker(#209)
- Feature: If an error instance responds to
#marks_semian_circuits?don't mark the circuit if it returns false (#210)
- Fix: Redis adapter using hiredis is resilient to DNS resolution failures (#205)
- Feature: Introduce
half_open_resource_timeoutwhich changes the resource timeout when the circuit is in a half-open state for the Net::HTTP adapter. (#198) - Feature: Add the cause of the last error when a circuit opens (#197)
- Fix: Reset successes when transitioning to the half open state (#192)
- Fix: Expose
half_open?when the circuit state has not transitioned but will. This allows consumers further up the stack to know if the circuit is half open.
- Feature: Introduce
half_open_resource_timeoutwhich changes the resource timeout when the circuit is in a half-open state (#188)
- Feature: More informative error messages when initializing Semian with missing arguments (#182)
- Fix: Redis adapter is now resilient to DNS resolution failures (#184)
- Fix: Repaired compatibility with dependent Redis library
- Fix: Protect internal semaphore when adjusting resource count (#164)
- Feature: Use prepend when monkey-patching Net::HTTP. (#157)
- Feature: Include time spend waiting for bulkhead in notification (#154)
- Feature: Add the behaviour to enable open circuiting on 5xxs conditionally (#149)
- Refactor: Configurable hosts for Semian's development dependencies (#152)
This change introduced a series of changes to support a new "dynamic quota" ticket allocation strategy. This code primarily affects bulkheads (protected resources).
Rather than statically setting a ticket count, workers (in their own process) now register themselves. By specifying 'quota' instead of 'tickets', the bulkhead threshold will now be computed dynamically as a ratio of the number of registered workers, eliminating the need to continuously readjust ticket counts, and supporting environments with non-uniform worker distribution between machines.
- Feature: Support quota based allocation strategy (#120)
- Feature: Add ability to manually unregister workers (#130)
- Feature: Add ability to clear resources from adapters and unregister all resources (#134)
- Feature: Allow sysV IPC key to be accessed in ruby (#136)
- Feature: Expose registered worker count to ruby (#137)
- Refactor: Allow registered worker count to be accessed through bulkhead (#138)
- Bug fix: Register all workers (#128)
- Bug fix: Lazy instantiate redis clien on first I/O (#132)
- Bug fix: New mysql error (#131)
- Bug fix: Prevent race conditions when unregistering (#141)
- Refactor/Feature: Break coupling between resource and circuit breaker (#123)
- Refactor: Use generic max_sem_val (#117)
- Refactor: Fix header syntax (#118)
- Refactor: Always acquire semaphore without_gvl (#121)
- Thread-safety for circuit breakers by default (#150)
- Fix bug where calling name on a protected resource without a semaphore would fail (#151)
- Refactor: Refactor semian ticket management into its own files (#116)
- Refactor: Create sem_meta_lock and sem_meta_unlock (#115)
- Refactor: Refactor semaphore operations (#114)
- Refactor: Generate a unique semaphore key by including size of semaphore set
- Refactor: Refactor semian_resource related C functions
- Fix: Don't require sudo for travis (#110)
- Refactor: Refactor semian.c includes and types into header files
- Fix: Use glob instead of git for gemspec file list
- Fix: Fix travis CI for ruby 2.3.0 installing rainbows
- Refactor: Switch to enumerated type for tracking semaphore indices
- Docs: readme: explain co-operation between cbs and bulkheads
- Docs: readme: add section about server limits
- Feature: Load semian/rails automatically if necessary
- Feature: Implement AR::AbstractAdapter#semian_resource
- Fix: Also let "Too many connections" be a first class conn error
- Fix: mysql: protect pings
- Fix: mysql: match more lost conn queries
- Fix: Make request_allowed? thread safe
- Fix: Fix CI connect errors on HTTP requests by using 127.0.0.1 for host
- Fix: Assert Resource#initialize_semaphore contract on Resource init
- Fix: Lock on older thin version for pre MRI 2.2 compatibility
- Fix: Only issue unsupported or disabled semaphores warnings when the first resource is instanciated
- Refactor: Cleanup requires
- Maintenance: Use published version of the toxiproxy gem
- Fix: Fix minitest deprecation warnings
- Maintenance: Update bundler on travis
- Maintenance: Update supported MRI versions on travis
- Fix: Fix lazy aliasing of Redis#semian_resource
- Fix: Workaround rubocop parser limitations
- Fix: Fix for TimeoutError is deprecated in Ruby 2.3.0
- Feature: Include Ruby 2.3 in Travis builds
- Fix: resource: cast float ticket count to fixnum #75
- Feature: net/http: add adapter for net/http #58
- Refactor: circuit_breaker: split circuit breaker into three data structures to allow for alternative implementations in the future #62
- Fix: mysql: don't prevent rollbacks on transactions #60
- Fix: core: fix initialization bug when the resource is accessed before the options are set #65