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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d545433883dc728547208b3498cfc683c76162ddcc7ef888f78fe9bbcb291fd
4
- data.tar.gz: 5ad448a849648fcaf025c34949edd7ec09220e11be0aedac756dae7133122660
3
+ metadata.gz: 934d4c9af299e5d13e15da2f730fdc7360ab976b87876da8651347cc923d6e4d
4
+ data.tar.gz: df8e60c1c2670a82ffe4a0f7add3ebb035750e39448050c0f6eebfed2b6044ce
5
5
  SHA512:
6
- metadata.gz: 62b63172647661d52856dc4c1bdefcd9d5336be3ca347b61ed51c63d83a4fe67906a258385cac7c9fd2fcae1798d1bc099d7269e4e8fa0c885a049db43131421
7
- data.tar.gz: a47d3b669a8ebc2e111deb44a9aac655073572460da6088c64d98a8105f9f32ce93ba1f132298f9ebe3fa4a858a136f26d1eb80d71f667bb1eddeb246b37f2f3
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nonnative (1.97.0)
4
+ nonnative (1.98.0)
5
5
  concurrent-ruby (>= 1, < 2)
6
6
  config (>= 5, < 6)
7
7
  cucumber (>= 7, < 10)
@@ -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
- accept_connection local_socket
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(local_socket)
63
- id = Thread.current.object_id
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 '#{socket_info}' and error '#{error}'"
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 '#{socket_info}'"
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(local_socket)
77
- pair = SocketPairFactory.create(read_state, service.proxy)
78
- pair.connect(local_socket)
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
- local_socket.close
82
+ socket.close
81
83
 
82
84
  e
83
85
  end
84
86
 
85
87
  def close_connections
86
- connections.each_value(&:terminate)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nonnative
4
- VERSION = '1.97.0'
4
+ VERSION = '1.98.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nonnative
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.97.0
4
+ version: 1.98.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alejandro Falkowski