nonnative 3.9.0 → 3.10.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 +4 -4
- data/.circleci/config.yml +2 -2
- data/AGENTS.md +5 -0
- data/Gemfile.lock +1 -1
- data/README.md +3 -1
- data/lib/nonnative/process.rb +7 -11
- data/lib/nonnative/version.rb +1 -1
- data/lib/nonnative.rb +3 -0
- 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: 6a276b7ac5edae149fc6eb065909773b73c5c7e1684e4502244d88a0cdd6c521
|
|
4
|
+
data.tar.gz: 82545f52a383ba1f67af5c1d01c72653adee7339a3e1968fb987eabc9236421e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0eea335efd1554822d7153077244d2f8ff5d19c46af6b19e153bd0298e99e4902f090b933899d4614e46a88252d9b95e9f7ec92b3d6e9e824c96f00694d579f9
|
|
7
|
+
data.tar.gz: ce2d8e41f9313b289c3531fe8c605e869dd856a1eb8ae47bb1671ebc12aa1f97a3a8e795cad16681c11857b2a70ce4f2250b0310dd57286162cc9aed7efa764e
|
data/.circleci/config.yml
CHANGED
|
@@ -32,13 +32,13 @@ jobs:
|
|
|
32
32
|
- restore_cache:
|
|
33
33
|
name: restore deps
|
|
34
34
|
keys:
|
|
35
|
-
- nonnative-ruby-cache-{{ checksum "Gemfile.lock" }}-{{ checksum "~/.ruby-version" }}
|
|
35
|
+
- nonnative-ruby-cache-{{ checksum "Gemfile.lock" }}-{{ checksum "~/.ruby-version" }}
|
|
36
36
|
- nonnative-ruby-cache-
|
|
37
37
|
- run: make dep
|
|
38
38
|
- run: make clean-dep
|
|
39
39
|
- save_cache:
|
|
40
40
|
name: save deps
|
|
41
|
-
key: nonnative-ruby-cache-{{ checksum "Gemfile.lock" }}-{{ checksum "~/.ruby-version" }}
|
|
41
|
+
key: nonnative-ruby-cache-{{ checksum "Gemfile.lock" }}-{{ checksum "~/.ruby-version" }}
|
|
42
42
|
paths:
|
|
43
43
|
- vendor
|
|
44
44
|
- run: make lint
|
data/AGENTS.md
CHANGED
|
@@ -74,6 +74,11 @@ of dependencies.
|
|
|
74
74
|
use `nonnative` against real dependencies. Do not flag the in-repository
|
|
75
75
|
service proxy success scenario's connection-only assertion as a test gap
|
|
76
76
|
unless the task is explicitly about changing service proxy forwarding.
|
|
77
|
+
- `Nonnative::FaultInjectionProxy` owns its listener thread and stops it by
|
|
78
|
+
closing the owned `TCPServer`, which wakes the accept loop before joining the
|
|
79
|
+
thread. Do not flag the listener `join` as an unbounded reliability gap unless
|
|
80
|
+
the task is explicitly about proxy shutdown behavior or there is a normal-use
|
|
81
|
+
reproducer, failing CI evidence, or platform-specific hang evidence.
|
|
77
82
|
|
|
78
83
|
## Runtime Model
|
|
79
84
|
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -94,7 +94,9 @@ Nonnative.stop
|
|
|
94
94
|
`Nonnative.start` starts services first, then servers and processes. `Nonnative.stop` stops processes and servers first, then services. If startup fails, Nonnative rolls back runners that already started and raises `Nonnative::StartError`; shutdown failures raise `Nonnative::StopError`.
|
|
95
95
|
|
|
96
96
|
> [!NOTE]
|
|
97
|
-
> `Nonnative.
|
|
97
|
+
> `Nonnative.start` / `Nonnative.stop` manage one lifecycle for the current pool.
|
|
98
|
+
> Call `Nonnative.clear` before reconfiguring Nonnative or starting a new lifecycle in the same Ruby process.
|
|
99
|
+
> `Nonnative.clear` clears memoized configuration, logger, observability client, and pool.
|
|
98
100
|
|
|
99
101
|
### 📈 Observability
|
|
100
102
|
|
data/lib/nonnative/process.rb
CHANGED
|
@@ -20,6 +20,9 @@ module Nonnative
|
|
|
20
20
|
@timeout = Nonnative::Timeout.new(service.timeout)
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
+
# @return [GetProcessMem, nil] memory reader for the current process lifecycle
|
|
24
|
+
attr_reader :memory
|
|
25
|
+
|
|
23
26
|
# Spawns the configured process if it is not already running.
|
|
24
27
|
#
|
|
25
28
|
# @return [Array<(Integer, Boolean)>]
|
|
@@ -29,6 +32,8 @@ module Nonnative
|
|
|
29
32
|
def start
|
|
30
33
|
unless process_exists?
|
|
31
34
|
@pid = process_spawn
|
|
35
|
+
# Keep memory reads bound to the child spawned for this lifecycle.
|
|
36
|
+
@memory = GetProcessMem.new(pid)
|
|
32
37
|
wait_start
|
|
33
38
|
end
|
|
34
39
|
|
|
@@ -53,17 +58,8 @@ module Nonnative
|
|
|
53
58
|
end
|
|
54
59
|
|
|
55
60
|
[pid, stopped]
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
# Returns a memoized memory reader for the spawned process.
|
|
59
|
-
#
|
|
60
|
-
# This is primarily used by acceptance tests to assert memory usage.
|
|
61
|
-
#
|
|
62
|
-
# @return [GetProcessMem, nil] a memory reader for the pid, or `nil` if not started
|
|
63
|
-
def memory
|
|
64
|
-
return if pid.nil?
|
|
65
|
-
|
|
66
|
-
@memory ||= GetProcessMem.new(pid)
|
|
61
|
+
ensure
|
|
62
|
+
@memory = nil
|
|
67
63
|
end
|
|
68
64
|
|
|
69
65
|
protected
|
data/lib/nonnative/version.rb
CHANGED
data/lib/nonnative.rb
CHANGED
|
@@ -286,6 +286,9 @@ module Nonnative
|
|
|
286
286
|
|
|
287
287
|
# Clears memoized configuration, logger, observability client, and pool.
|
|
288
288
|
#
|
|
289
|
+
# Call this before reconfiguring Nonnative or starting a new lifecycle in the same Ruby process.
|
|
290
|
+
# `start`/`stop` are intended to manage one lifecycle for the current pool.
|
|
291
|
+
#
|
|
289
292
|
# @return [void]
|
|
290
293
|
def clear
|
|
291
294
|
clear_logger
|