gritz 0.2.0 → 0.4.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a95e6912024249ab3efc8753e49f5c6221348413a9a9fd3f4d17157169336676
4
- data.tar.gz: 40abe904ca3558e321c80db1bb3f87294ca1c98f47ed9f695c37048c2510fd2d
3
+ metadata.gz: dc0e22df75d36cf07bf9460cedc802981539bb78f0498ebfced84d6439169abd
4
+ data.tar.gz: 9f6969d88f42cfc646d6d55c22b4df5decfa295efaff75b74feafeec08b445c3
5
5
  SHA512:
6
- metadata.gz: 3e47c08e7623f8c44055996696945cbd77a8cbd32b730836ebee07a3b95ea6eb50b0a9d213daa83b74f28a7d415b32310277c1596ffe0982945deccf9db9763c
7
- data.tar.gz: 577748ed23020e59a82224bc074044ee77ec6ed065fc47a7243754fc00e553ef2f32e4417c8bbdcbd0401f8216a3350e54d55194469c4fd00c1438ca973b0e49
6
+ metadata.gz: '05139a36134b9276b6cfaa9f33d59617bfaadb5f47f78d5436c075ab18c58be53a0e4178d64a3202b4fcd23c6a540eb90e896e6aeac97711f32eadae8448c927'
7
+ data.tar.gz: fc8c7c87cfe8958731c9a45613bec960d33f2240e8d06786c667232c3b3a15b04428bfab7c03c9f3f4b2c27505c91644dfb5529e8945ceb32f32bfc8239c2b6f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.0
4
+
5
+ - Add fork-safe clients for all four RPC forms, with deadline and request-header propagation and client middleware.
6
+ - Preserve typed downstream errors and rich details while returning safe `INTERNAL` responses for unhandled downstream failures.
7
+ - Support native retry and load-balancing service configuration and optional OpenTelemetry integration.
8
+
9
+ ## 0.3.0
10
+
11
+ - Add phased worker replacement, hot application reload, worker recycling and stable admin probes with Prometheus metrics.
12
+ - Support native TLS, mTLS and gRPC Health Check/Watch.
13
+ - Add structured RPC logs with credential redaction and preserve accepted calls during graceful shutdown.
14
+
3
15
  ## 0.2.0
4
16
 
5
17
  - Support Linux forked workers, automatic replacement, graceful shutdown and dynamic worker counts.
data/README.md CHANGED
@@ -11,8 +11,9 @@ Requires CRuby 3.3 or later and grpc 1.83 or later. Linux and macOS are tested.
11
11
  | `gritz` | [gritzrpc/gritz](https://github.com/gritzrpc/gritz) | Default combination and executable |
12
12
  | `gritz-core` | [gritzrpc/gritz-core](https://github.com/gritzrpc/gritz-core) | Transport-independent application framework |
13
13
  | `gritz-native` | [gritzrpc/gritz-native](https://github.com/gritzrpc/gritz-native) | Official grpc gem adapter and thread pool |
14
+ | `gritz-otel` | [gritzrpc/gritz-otel](https://github.com/gritzrpc/gritz-otel) | Optional server/client tracing and worker OTLP metrics |
14
15
 
15
- Applications can add `gem "gritz", "~> 0.2.0"` to their Gemfile. It installs both the core and native adapter. The Fiber adapter `gritz-async` and integrations `gritz-rails` / `gritz-otel` are planned.
16
+ Applications can add `gem "gritz", "~> 0.4.0"` to their Gemfile. It installs both the core and native adapter. Add `gritz-otel` for OpenTelemetry. The Fiber adapter `gritz-async` and Rails integration `gritz-rails` are planned.
16
17
 
17
18
  ## Quickstart from source
18
19
 
@@ -67,6 +68,10 @@ Set `strict_routes true` once every RPC in the bound service has an action; othe
67
68
 
68
69
  The default middleware adds request IDs, scopes context, writes JSON completion logs and converts exceptions to gRPC errors. Internal errors expose an `error-id` trailer rather than application exception messages. `fail!` accepts status symbols, trailing metadata and protobuf rich error details. Middleware wraps the full stream, including incremental response writes.
69
70
 
71
+ ## Clients
72
+
73
+ For downstream calls, define a lazy client with `Gritz::Client.define(Helloworld::Greeter::Stub, target: "localhost:50051", deadline: 2.0)`. It shares a channel within each worker, inherits the parent deadline and selected request headers, and wraps complete streams in client middleware. See the [client guide](https://github.com/gritzrpc/gritz-core/blob/main/docs/guides/clients.md).
74
+
70
75
  ## Testing
71
76
 
72
77
  ```ruby
@@ -93,7 +98,9 @@ Configuration precedence is CLI options, `GRITZ_*` environment variables, config
93
98
 
94
99
  Use `TERM` or `INT` to finish in-flight calls within `shutdown_timeout`; `QUIT` closes immediately. Application code should check deadlines and cancellation during long work. The grpc 1.83 server view can report cancellation late; deadlines remain the practical limit for long handlers. The native thread pool rejects excess requests immediately with `RESOURCE_EXHAUSTED`; grpc 1.83 ignores its deprecated `max_waiting_requests` setting.
95
100
 
96
- The server binds insecure gRPC sockets. Use a trusted network or a TLS-terminating proxy. Native TLS, health checks, reflection and metrics export are unavailable. Unsupported transport and TLS features fail at startup.
101
+ Configure `tls cert:, key:` for TLS and add `client_ca:` for required client certificates. Native gRPC Health Check/Watch follows named `health_check` callbacks and worker draining. Admin HTTP provides `/livez`, `/readyz`, `/status` and Prometheus `/metrics` at `127.0.0.1:9090` by default. Reflection is planned.
102
+
103
+ For Linux operations, use `USR1` to replace workers one at a time and `USR2` to load fresh Ruby code/configuration in a new master. The CLI launcher retains probes and metric totals while old masters drain; a failed replacement leaves the active master serving. Configure `worker_recycle` to replace workers by requests, PSS/RSS or lifetime. See the [Kubernetes guide](https://github.com/gritzrpc/gritz-native/blob/main/docs/guides/kubernetes.md).
97
104
 
98
105
  The default transport is `:native` (`Gritz::Transport::Native`). `gritz-core` can be loaded separately with `require "gritz/core"` without loading grpc.
99
106
 
data/exe/gritz CHANGED
@@ -1,6 +1,10 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- require "gritz"
4
+ require "gritz/core"
5
+ require "rbconfig"
6
+ require "socket"
5
7
 
6
- exit Gritz::CLI.new.run(ARGV)
8
+ owner_fd = ENV.delete("GRITZ_INTERNAL_OWNER_FD")
9
+ exit Gritz::CLI.new(launch: owner_fd.nil?, owner_io: owner_fd && UNIXSocket.for_fd(Integer(owner_fd)),
10
+ launch_command: [RbConfig.ruby, File.expand_path($PROGRAM_NAME), *ARGV]).run(ARGV)
data/lib/gritz/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Gritz
4
- VERSION = "0.2.0"
4
+ VERSION = "0.4.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gritz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yudai Takada
@@ -15,28 +15,28 @@ dependencies:
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 0.2.0
18
+ version: 0.4.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - '='
24
24
  - !ruby/object:Gem::Version
25
- version: 0.2.0
25
+ version: 0.4.0
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: gritz-native
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
30
30
  - - '='
31
31
  - !ruby/object:Gem::Version
32
- version: 0.2.0
32
+ version: 0.4.0
33
33
  type: :runtime
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - '='
38
38
  - !ruby/object:Gem::Version
39
- version: 0.2.0
39
+ version: 0.4.0
40
40
  description: Gritz combines transport-independent controllers, middleware and testing
41
41
  with a gRPC C-core server.
42
42
  email: