yes-core 2.6.0 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/yes/core/authorization/cerbos_grpc_retry_policy.rb +17 -1
- data/lib/yes/core/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3628c3ea30a5599fa97c6533fd10d2214a0d5da009760b265fd0c11f8490349f
|
|
4
|
+
data.tar.gz: b223d9f7ba3ba16cc2f4d267aabfca2a2c5f6aa6335a3c4388a8f98edc5978dd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d676304cb10bdc7714ce0b3f4cd45bbcbf85242bd9ce75f13a1ef3683ed042e6849378f007ccaedc448af1cbf4a49b4b2e770c5606474c7e7dd052d59cd9077b
|
|
7
|
+
data.tar.gz: a27b098783deeee35962fa5694f4fdaff7fd26a58d58b0a66bf6f799ca0d8ad1d0c79da259e266aec823abe450cdcde3942821e8fa8f3d6caece61115779eadd
|
data/CHANGELOG.md
CHANGED
|
@@ -11,7 +11,14 @@ module Yes
|
|
|
11
11
|
# caller never sees a `Cerbos::Error::Unavailable` for a blip that a second attempt on a
|
|
12
12
|
# healthy pod would have answered.
|
|
13
13
|
#
|
|
14
|
+
# A refused connection (a pod that stopped listening but is still routed to) also puts the
|
|
15
|
+
# channel into reconnect backoff, during which every call fails immediately. gRPC's default
|
|
16
|
+
# backoff (1s, growing to 120s) outlasts the retry window above, so a single process would
|
|
17
|
+
# keep failing every request for many seconds. The reconnect backoff is therefore capped to
|
|
18
|
+
# the same order of magnitude as the retry backoff.
|
|
19
|
+
#
|
|
14
20
|
# @see https://grpc.io/docs/guides/retry/
|
|
21
|
+
# @see https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md
|
|
15
22
|
module CerbosGrpcRetryPolicy
|
|
16
23
|
SERVICE_NAME = 'cerbos.svc.v1.CerbosService'
|
|
17
24
|
MAX_ATTEMPTS = 4
|
|
@@ -23,12 +30,21 @@ module Yes
|
|
|
23
30
|
ENABLE_RETRIES_ARG = 'grpc.enable_retries'
|
|
24
31
|
SERVICE_CONFIG_ARG = 'grpc.service_config'
|
|
25
32
|
|
|
33
|
+
RECONNECT_BACKOFF_MS = 100
|
|
34
|
+
MAX_RECONNECT_BACKOFF_MS = 1_000
|
|
35
|
+
MIN_RECONNECT_BACKOFF_ARG = 'grpc.min_reconnect_backoff_ms'
|
|
36
|
+
INITIAL_RECONNECT_BACKOFF_ARG = 'grpc.initial_reconnect_backoff_ms'
|
|
37
|
+
MAX_RECONNECT_BACKOFF_ARG = 'grpc.max_reconnect_backoff_ms'
|
|
38
|
+
|
|
26
39
|
class << self
|
|
27
40
|
# @return [Hash{String => Integer, String}] channel arguments for `Cerbos::Client.new`
|
|
28
41
|
def channel_args
|
|
29
42
|
{
|
|
30
43
|
ENABLE_RETRIES_ARG => 1,
|
|
31
|
-
SERVICE_CONFIG_ARG => service_config.to_json
|
|
44
|
+
SERVICE_CONFIG_ARG => service_config.to_json,
|
|
45
|
+
MIN_RECONNECT_BACKOFF_ARG => RECONNECT_BACKOFF_MS,
|
|
46
|
+
INITIAL_RECONNECT_BACKOFF_ARG => RECONNECT_BACKOFF_MS,
|
|
47
|
+
MAX_RECONNECT_BACKOFF_ARG => MAX_RECONNECT_BACKOFF_MS
|
|
32
48
|
}
|
|
33
49
|
end
|
|
34
50
|
|
data/lib/yes/core/version.rb
CHANGED