semian 0.12.0 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +235 -0
- data/LICENSE.md +21 -0
- data/README.md +836 -0
- data/ext/semian/extconf.rb +21 -19
- data/lib/semian/adapter.rb +8 -4
- data/lib/semian/circuit_breaker.rb +16 -10
- data/lib/semian/grpc.rb +32 -10
- data/lib/semian/instrumentable.rb +2 -0
- data/lib/semian/lru_hash.rb +15 -14
- data/lib/semian/mysql2.rb +13 -9
- data/lib/semian/net_http.rb +10 -4
- data/lib/semian/platform.rb +3 -1
- data/lib/semian/protected_resource.rb +5 -3
- data/lib/semian/rails.rb +12 -6
- data/lib/semian/redis.rb +15 -13
- data/lib/semian/redis_client.rb +5 -3
- data/lib/semian/resource.rb +5 -3
- data/lib/semian/simple_integer.rb +4 -2
- data/lib/semian/simple_sliding_window.rb +5 -3
- data/lib/semian/simple_state.rb +3 -1
- data/lib/semian/unprotected_resource.rb +2 -0
- data/lib/semian/version.rb +3 -1
- data/lib/semian.rb +61 -45
- metadata +11 -201
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84f862d0b3bcde3015576c4965229c14d188683f16c567256df7cf915c692874
|
4
|
+
data.tar.gz: e03971099a9f6b605c8dc73abe332f91908467dd24e2cb4bd0ba1f802e3f249d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a23498d15ccb457f76c4f7afbb858deed86aedc7fb97605b198578714aace1e14390c84be367add408b7b444e3350c7cce117dc608750b413e085ce10c06ed44
|
7
|
+
data.tar.gz: 47e0f1be5613745ed37a6854ab82979e94eba4e53deb187035678dbdc4f3e781d5db9a97c2e34e7eef0386d6344cba1f34948a03252d058a50f600f7a96a438c
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,235 @@
|
|
1
|
+
# Unreleased
|
2
|
+
|
3
|
+
# v0.13.0
|
4
|
+
|
5
|
+
* Refactor: Replace Time.now with CLOCK_MONOTONIC in MockServer (#318)
|
6
|
+
* Fix: Circuit not open for GRPC::ActiveCall::Operation failures (#348)
|
7
|
+
|
8
|
+
# v0.12.0
|
9
|
+
|
10
|
+
* Feature: Add support for the `redis-client` gem (#314)
|
11
|
+
|
12
|
+
# v0.11.8
|
13
|
+
|
14
|
+
* Feature: Add error_threshold_timeout configuration parameter (#299)
|
15
|
+
|
16
|
+
# v0.11.7
|
17
|
+
|
18
|
+
* Fix: ECONNRESET won't trigger circuit open for redis (#306)
|
19
|
+
|
20
|
+
# v0.11.6
|
21
|
+
|
22
|
+
* Fix: pass disable flag by patching new singleton method (#303)
|
23
|
+
|
24
|
+
# v0.11.5
|
25
|
+
|
26
|
+
* Feature: Add disable flag to http adapter (#301)
|
27
|
+
|
28
|
+
# v0.11.4
|
29
|
+
|
30
|
+
* Fix: Add `extern` to global variable declarations for gcc 10 (#288)
|
31
|
+
|
32
|
+
# v0.11.3
|
33
|
+
|
34
|
+
* Feature: Log last error message on circuit breaker state transition (#285)
|
35
|
+
* Fix: Update README and docs to resolve common misconception about error_threshold (#283)
|
36
|
+
|
37
|
+
# v0.11.2
|
38
|
+
|
39
|
+
* Fix: Remove `MySQL client is not connected` error from mysql2 adapter
|
40
|
+
|
41
|
+
# v0.11.1
|
42
|
+
|
43
|
+
* Feature: Add `Semian.namespace` to globally prefix all the semaphore names. (#280)
|
44
|
+
|
45
|
+
# v0.11.0
|
46
|
+
|
47
|
+
* Feature: Add `Semian.default_permissions` to globally change the default semaphore permissions. (#279)
|
48
|
+
|
49
|
+
# v0.10.6
|
50
|
+
|
51
|
+
* Fix: Match whitelisted SQL queries when Marginalia is prepended (#276)
|
52
|
+
|
53
|
+
# v0.10.5
|
54
|
+
|
55
|
+
* Fix: Compatibility with GC.compact
|
56
|
+
|
57
|
+
# v0.10.4
|
58
|
+
|
59
|
+
* Fix: Revert the changes in v0.10.3. (#270)
|
60
|
+
|
61
|
+
# v0.10.3
|
62
|
+
|
63
|
+
* Fix: Positional/Keyword arguments deprecations warning for Ruby 2.7 in the grpc adapter. (#269)
|
64
|
+
|
65
|
+
# v0.10.2
|
66
|
+
|
67
|
+
* Fix: Positional/Keyword arguments deprecations warning for Ruby 2.7.
|
68
|
+
|
69
|
+
# v0.10.1
|
70
|
+
|
71
|
+
* Fix: thread safety bug on Ruby 2.7. (#263)
|
72
|
+
|
73
|
+
# v0.10.0
|
74
|
+
|
75
|
+
* Feature: Support half open resource timeout for redis.
|
76
|
+
|
77
|
+
# v0.9.1
|
78
|
+
|
79
|
+
* Fix: Compatibility with MRI 2.3
|
80
|
+
|
81
|
+
# v0.9.0
|
82
|
+
|
83
|
+
* Feature: Add a LRU to garbage collect old resources. (#193)
|
84
|
+
|
85
|
+
# v0.8.9
|
86
|
+
* Fix: Recursion issue in MySQL2 adapter causing circuits breakers to stay open much longer than they should. (#250)
|
87
|
+
* Fix: Better handle DNS resolutions exceptions in Redis adapter. (#230)
|
88
|
+
|
89
|
+
# v0.8.8
|
90
|
+
* Feature: Introduce the GRPC adapter (#200)
|
91
|
+
|
92
|
+
# v0.8.7
|
93
|
+
* Fix: Instrument success for `acquire_circuit_breaker` (#209)
|
94
|
+
|
95
|
+
# v0.8.6
|
96
|
+
* Feature: If an error instance responds to `#marks_semian_circuits?` don't mark the circuit if it returns false (#210)
|
97
|
+
|
98
|
+
# v0.8.5
|
99
|
+
* Fix: Redis adapter using hiredis is resilient to DNS resolution failures (#205)
|
100
|
+
|
101
|
+
# v0.8.4
|
102
|
+
* Feature: Introduce `half_open_resource_timeout` which changes the resource timeout when the circuit is in a half-open state for the Net::HTTP adapter. (#198)
|
103
|
+
* Feature: Add the cause of the last error when a circuit opens (#197)
|
104
|
+
* Fix: Reset successes when transitioning to the half open state (#192)
|
105
|
+
|
106
|
+
# v0.8.1
|
107
|
+
|
108
|
+
* 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
|
109
|
+
is half open.
|
110
|
+
|
111
|
+
# v0.8.0
|
112
|
+
|
113
|
+
* Feature: Introduce `half_open_resource_timeout` which changes the resource timeout when the circuit is in a half-open state (#188)
|
114
|
+
|
115
|
+
# v0.7.8
|
116
|
+
|
117
|
+
* Feature: More informative error messages when initializing Semian with missing
|
118
|
+
arguments (#182)
|
119
|
+
* Fix: Redis adapter is now resilient to DNS resolution failures (#184)
|
120
|
+
|
121
|
+
# v0.7.5
|
122
|
+
|
123
|
+
* Fix: Repaired compatibility with dependent Redis library
|
124
|
+
|
125
|
+
# v0.7.4
|
126
|
+
|
127
|
+
* Fix: Protect internal semaphore when adjusting resource count (#164)
|
128
|
+
* Feature: Use prepend when monkey-patching Net::HTTP. (#157)
|
129
|
+
* Feature: Include time spend waiting for bulkhead in notification (#154)
|
130
|
+
|
131
|
+
# v0.7.1
|
132
|
+
|
133
|
+
* Feature: Add the behaviour to enable open circuiting on 5xxs conditionally (#149)
|
134
|
+
* Refactor: Configurable hosts for Semian's development dependencies (#152)
|
135
|
+
|
136
|
+
# v0.7.0
|
137
|
+
|
138
|
+
This change introduced a series of changes to support a new "dynamic quota" ticket
|
139
|
+
allocation strategy. This code primarily affects bulkheads (protected resources).
|
140
|
+
|
141
|
+
Rather than statically setting a ticket count, workers (in their own process) now register
|
142
|
+
themselves. By specifying 'quota' instead of 'tickets', the bulkhead threshold will now be
|
143
|
+
computed dynamically as a ratio of the number of registered workers, eliminating the need to
|
144
|
+
continuously readjust ticket counts, and supporting environments with non-uniform worker
|
145
|
+
distribution between machines.
|
146
|
+
|
147
|
+
* Feature: Support quota based allocation strategy (#120)
|
148
|
+
* Feature: Add ability to manually unregister workers (#130)
|
149
|
+
* Feature: Add ability to clear resources from adapters and unregister all resources (#134)
|
150
|
+
* Feature: Allow sysV IPC key to be accessed in ruby (#136)
|
151
|
+
* Feature: Expose registered worker count to ruby (#137)
|
152
|
+
* Refactor: Allow registered worker count to be accessed through bulkhead (#138)
|
153
|
+
* Bug fix: Register all workers (#128)
|
154
|
+
* Bug fix: Lazy instantiate redis clien on first I/O (#132)
|
155
|
+
* Bug fix: New mysql error (#131)
|
156
|
+
* Bug fix: Prevent race conditions when unregistering (#141)
|
157
|
+
* Refactor/Feature: Break coupling between resource and circuit breaker (#123)
|
158
|
+
* Refactor: Use generic max_sem_val (#117)
|
159
|
+
* Refactor: Fix header syntax (#118)
|
160
|
+
* Refactor: Always acquire semaphore without_gvl (#121)
|
161
|
+
* Thread-safety for circuit breakers by default (#150)
|
162
|
+
* Fix bug where calling name on a protected resource without a semaphore would fail (#151)
|
163
|
+
|
164
|
+
# v0.6.2
|
165
|
+
|
166
|
+
* Refactor: Refactor semian ticket management into its own files (#116)
|
167
|
+
* Refactor: Create sem_meta_lock and sem_meta_unlock (#115)
|
168
|
+
* Refactor: Refactor semaphore operations (#114)
|
169
|
+
|
170
|
+
# v0.6.1
|
171
|
+
|
172
|
+
* Refactor: Generate a unique semaphore key by including size of semaphore set
|
173
|
+
* Refactor: Refactor semian\_resource related C functions
|
174
|
+
* Fix: Don't require sudo for travis (#110)
|
175
|
+
* Refactor: Refactor semian.c includes and types into header files
|
176
|
+
* Fix: Use glob instead of git for gemspec file list
|
177
|
+
* Fix: Fix travis CI for ruby 2.3.0 installing rainbows
|
178
|
+
* Refactor: Switch to enumerated type for tracking semaphore indices
|
179
|
+
* Docs: readme: explain co-operation between cbs and bulkheads
|
180
|
+
* Docs: readme: add section about server limits
|
181
|
+
|
182
|
+
# v0.6.0
|
183
|
+
|
184
|
+
* Feature: Load semian/rails automatically if necessary
|
185
|
+
* Feature: Implement AR::AbstractAdapter#semian\_resource
|
186
|
+
|
187
|
+
# v0.5.4
|
188
|
+
|
189
|
+
* Fix: Also let "Too many connections" be a first class conn error
|
190
|
+
|
191
|
+
# v0.5.3
|
192
|
+
|
193
|
+
* Fix: mysql: protect pings
|
194
|
+
* Fix: mysql: match more lost conn queries
|
195
|
+
|
196
|
+
# v0.5.2
|
197
|
+
|
198
|
+
* Fix: Make request\_allowed? thread safe
|
199
|
+
* Fix: Fix CI connect errors on HTTP requests by using 127.0.0.1 for host
|
200
|
+
|
201
|
+
# v0.5.1
|
202
|
+
|
203
|
+
* Fix: Assert Resource#initialize\_semaphore contract on Resource init
|
204
|
+
* Fix: Lock on older thin version for pre MRI 2.2 compatibility
|
205
|
+
|
206
|
+
# v0.5.0
|
207
|
+
|
208
|
+
* Fix: Only issue unsupported or disabled semaphores warnings when the first resource is instanciated
|
209
|
+
* Refactor: Cleanup requires
|
210
|
+
* Maintenance: Use published version of the toxiproxy gem
|
211
|
+
* Fix: Fix minitest deprecation warnings
|
212
|
+
* Maintenance: Update bundler on travis
|
213
|
+
* Maintenance: Update supported MRI versions on travis
|
214
|
+
|
215
|
+
# v0.4.3
|
216
|
+
|
217
|
+
* Fix: Fix lazy aliasing of Redis#semian\_resource
|
218
|
+
* Fix: Workaround rubocop parser limitations
|
219
|
+
|
220
|
+
# v0.4.2
|
221
|
+
|
222
|
+
* Fix: Fix for TimeoutError is deprecated in Ruby 2.3.0
|
223
|
+
* Feature: Include Ruby 2.3 in Travis builds
|
224
|
+
|
225
|
+
# v0.4.1
|
226
|
+
* Fix: resource: cast float ticket count to fixnum #75
|
227
|
+
|
228
|
+
# v0.4.0
|
229
|
+
|
230
|
+
* Feature: net/http: add adapter for net/http #58
|
231
|
+
* Refactor: circuit_breaker: split circuit breaker into three data structures to allow for
|
232
|
+
alternative implementations in the future #62
|
233
|
+
* Fix: mysql: don't prevent rollbacks on transactions #60
|
234
|
+
* Fix: core: fix initialization bug when the resource is accessed before the options
|
235
|
+
are set #65
|
data/LICENSE.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2014 Shopify
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|