nonnative 1.97.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 +4 -0
- data/Gemfile.lock +1 -1
- data/lib/nonnative/fault_injection_proxy.rb +20 -13
- 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,10 @@ 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
|
+
|
9
13
|
## [v1.97.0](https://github.com/alexfalkowski/nonnative/releases/tag/v1.97.0) - 2025-04-30
|
10
14
|
|
11
15
|
- [`367a78f`](https://github.com/alexfalkowski/nonnative/commit/367a78fa8615ebe3f68cb86fa416f7ea0f2cd63e) feat(socket): add logs for pairs (#549)
|
data/Gemfile.lock
CHANGED
@@ -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