nonnative 1.96.0 → 1.98.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/CHANGELOG.md +8 -0
- data/Gemfile.lock +5 -5
- data/lib/nonnative/close_all_socket_pair.rb +2 -0
- data/lib/nonnative/delay_socket_pair.rb +2 -0
- data/lib/nonnative/fault_injection_proxy.rb +20 -13
- data/lib/nonnative/invalid_data_socket_pair.rb +2 -0
- data/lib/nonnative/socket_pair.rb +2 -0
- data/lib/nonnative/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: 934d4c9af299e5d13e15da2f730fdc7360ab976b87876da8651347cc923d6e4d
|
4
|
+
data.tar.gz: df8e60c1c2670a82ffe4a0f7add3ebb035750e39448050c0f6eebfed2b6044ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4608ed449341bd5324cb8d1a9494f7c99a5f72eabbbbb9d99d0b8aea4329c4b79b36672b423e18905e38fa1e53cc34f991a8771650288e263d3731567f07685d
|
7
|
+
data.tar.gz: ae42739e124cd7de34af7bec323a76ac61822967968103816fad9c4a2460f95a536e78018969e01166c5649a303363fe4c2a2239850ac5952b843ea3ebdc91a2
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
|
7
7
|
## Unreleased
|
8
8
|
|
9
|
+
## [v1.98.0](https://github.com/alexfalkowski/nonnative/releases/tag/v1.98.0) - 2025-04-30
|
10
|
+
|
11
|
+
- [`7b81f58`](https://github.com/alexfalkowski/nonnative/commit/7b81f583b74175d63cc358955ad6033131bb3d73) feat(proxy): add more logs to diagnose (#551)
|
12
|
+
|
13
|
+
## [v1.97.0](https://github.com/alexfalkowski/nonnative/releases/tag/v1.97.0) - 2025-04-30
|
14
|
+
|
15
|
+
- [`367a78f`](https://github.com/alexfalkowski/nonnative/commit/367a78fa8615ebe3f68cb86fa416f7ea0f2cd63e) feat(socket): add logs for pairs (#549)
|
16
|
+
|
9
17
|
## [v1.96.0](https://github.com/alexfalkowski/nonnative/releases/tag/v1.96.0) - 2025-04-30
|
10
18
|
|
11
19
|
- [`281eb99`](https://github.com/alexfalkowski/nonnative/commit/281eb993fefb9dfda6118a23e811153e9acb0c02) feat(proxy): add logs for fault_injection (#548)
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
nonnative (1.
|
4
|
+
nonnative (1.98.0)
|
5
5
|
concurrent-ruby (>= 1, < 2)
|
6
6
|
config (>= 5, < 6)
|
7
7
|
cucumber (>= 7, < 10)
|
@@ -65,7 +65,7 @@ GEM
|
|
65
65
|
google-protobuf (4.30.2-x86_64-darwin)
|
66
66
|
bigdecimal
|
67
67
|
rake (>= 13)
|
68
|
-
googleapis-common-protos-types (1.
|
68
|
+
googleapis-common-protos-types (1.20.0)
|
69
69
|
google-protobuf (>= 3.18, < 5.a)
|
70
70
|
grpc (1.71.0-x86_64-darwin)
|
71
71
|
google-protobuf (>= 3.25, < 5.0)
|
@@ -80,7 +80,7 @@ GEM
|
|
80
80
|
mime-types (3.6.2)
|
81
81
|
logger
|
82
82
|
mime-types-data (~> 3.2015)
|
83
|
-
mime-types-data (3.2025.
|
83
|
+
mime-types-data (3.2025.0429)
|
84
84
|
mini_mime (1.1.5)
|
85
85
|
multi_test (1.1.0)
|
86
86
|
mustermann (3.0.3)
|
@@ -136,7 +136,7 @@ GEM
|
|
136
136
|
rspec-support (3.13.2)
|
137
137
|
rspec-wait (1.0.1)
|
138
138
|
rspec (>= 3.4)
|
139
|
-
rubocop (1.75.
|
139
|
+
rubocop (1.75.4)
|
140
140
|
json (~> 2.3)
|
141
141
|
language_server-protocol (~> 3.17.0.2)
|
142
142
|
lint_roller (~> 1.1.0)
|
@@ -173,7 +173,7 @@ GEM
|
|
173
173
|
rack-protection (= 4.1.1)
|
174
174
|
rack-session (>= 2.0.0, < 3)
|
175
175
|
tilt (~> 2.0)
|
176
|
-
sorbet-runtime (0.5.
|
176
|
+
sorbet-runtime (0.5.12046)
|
177
177
|
sys-uname (1.3.1)
|
178
178
|
ffi (~> 1.1)
|
179
179
|
tilt (2.6.0)
|
@@ -52,38 +52,45 @@ module Nonnative
|
|
52
52
|
def perform_start
|
53
53
|
loop do
|
54
54
|
thread = Thread.start(tcp_server.accept) do |local_socket|
|
55
|
-
|
55
|
+
id = Thread.current.object_id
|
56
|
+
|
57
|
+
accept_connection id, local_socket
|
56
58
|
end
|
57
59
|
|
58
60
|
connections[thread.object_id] = thread
|
59
61
|
end
|
60
62
|
end
|
61
63
|
|
62
|
-
def accept_connection(
|
63
|
-
|
64
|
-
socket_info = local_socket.inspect
|
65
|
-
|
66
|
-
error = connect(local_socket)
|
64
|
+
def accept_connection(id, socket)
|
65
|
+
error = connect(id, socket)
|
67
66
|
if error
|
68
|
-
logger.error "could not handle the connection for '#{id}' with socket '#{
|
67
|
+
logger.error "could not handle the connection for '#{id}' with socket '#{socket.inspect}' and error '#{error}'"
|
69
68
|
else
|
70
|
-
logger.info "handled connection for '#{id}' with socket '#{
|
69
|
+
logger.info "handled connection for '#{id}' with socket '#{socket.inspect}'"
|
71
70
|
end
|
72
71
|
|
73
72
|
connections.delete(id)
|
74
73
|
end
|
75
74
|
|
76
|
-
def connect(
|
77
|
-
|
78
|
-
|
75
|
+
def connect(id, socket)
|
76
|
+
state = read_state
|
77
|
+
Nonnative.logger.info "connecting for '#{id}' with socket '#{socket.inspect}' and state '#{state}' for proxy 'fault_injection'"
|
78
|
+
|
79
|
+
pair = SocketPairFactory.create(state, service.proxy)
|
80
|
+
pair.connect(socket)
|
79
81
|
rescue StandardError => e
|
80
|
-
|
82
|
+
socket.close
|
81
83
|
|
82
84
|
e
|
83
85
|
end
|
84
86
|
|
85
87
|
def close_connections
|
86
|
-
connections.
|
88
|
+
connections.each do |id, thread|
|
89
|
+
Nonnative.logger.info "closing connection for '#{id}' for proxy 'fault_injection'"
|
90
|
+
|
91
|
+
thread.terminate
|
92
|
+
end
|
93
|
+
|
87
94
|
connections.clear
|
88
95
|
end
|
89
96
|
|
@@ -16,6 +16,8 @@ module Nonnative
|
|
16
16
|
break if pipe(ready, remote_socket, local_socket)
|
17
17
|
end
|
18
18
|
ensure
|
19
|
+
Nonnative.logger.info "finished connect for local socket '#{local_socket.inspect}' and '#{remote_socket&.inspect}' for 'socket_pair'"
|
20
|
+
|
19
21
|
local_socket.close
|
20
22
|
remote_socket&.close
|
21
23
|
end
|
data/lib/nonnative/version.rb
CHANGED