nonnative 1.97.0 → 1.99.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: 5aeadf7d3e8832a39ac9d6b4a2966ca0ab714ddc235c03434a0186aaeb8944dd
4
+ data.tar.gz: 18f9bbe32e062de2c543a6d2b8d3eab60974e0f9bfc2ceac918316703a93cf3e
5
5
  SHA512:
6
- metadata.gz: 62b63172647661d52856dc4c1bdefcd9d5336be3ca347b61ed51c63d83a4fe67906a258385cac7c9fd2fcae1798d1bc099d7269e4e8fa0c885a049db43131421
7
- data.tar.gz: a47d3b669a8ebc2e111deb44a9aac655073572460da6088c64d98a8105f9f32ce93ba1f132298f9ebe3fa4a858a136f26d1eb80d71f667bb1eddeb246b37f2f3
6
+ metadata.gz: 9dfe6440f145b3920268305a70e0c31007f867538311199ff29b63bba2a46629c1d1f41329fa1dda6147551f53ba855ab822dacb19c25e3930def8b233ec04ca
7
+ data.tar.gz: 8c00438d0ec2ac47a953bdf195228b2d5b57f6e13c1ba79423f2887bf82522f444880fbc631ebc52f6bb0a27b0b0a6a4f9af37f877e6e1366de32b7c61113e9a
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.99.0](https://github.com/alexfalkowski/nonnative/releases/tag/v1.99.0) - 2025-05-01
10
+
11
+ - [`2009830`](https://github.com/alexfalkowski/nonnative/commit/200983099a376da5d769143b00552fc328444584) feat(server): add logging (#552)
12
+
13
+ ## [v1.98.0](https://github.com/alexfalkowski/nonnative/releases/tag/v1.98.0) - 2025-04-30
14
+
15
+ - [`7b81f58`](https://github.com/alexfalkowski/nonnative/commit/7b81f583b74175d63cc358955ad6033131bb3d73) feat(proxy): add more logs to diagnose (#551)
16
+
9
17
  ## [v1.97.0](https://github.com/alexfalkowski/nonnative/releases/tag/v1.97.0) - 2025-04-30
10
18
 
11
19
  - [`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.99.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
 
@@ -14,6 +14,8 @@ module Nonnative
14
14
  @thread = Thread.new { perform_start }
15
15
 
16
16
  wait_start
17
+
18
+ Nonnative.logger.info "started server '#{service.name}'"
17
19
  end
18
20
 
19
21
  [object_id, true]
@@ -27,6 +29,8 @@ module Nonnative
27
29
 
28
30
  @thread = nil
29
31
  wait_stop
32
+
33
+ Nonnative.logger.info "stopped server '#{service.name}'"
30
34
  end
31
35
 
32
36
  object_id
@@ -4,10 +4,14 @@ module Nonnative
4
4
  class Service < Runner
5
5
  def start
6
6
  proxy.start
7
+
8
+ Nonnative.logger.info "started service '#{service.name}'"
7
9
  end
8
10
 
9
11
  def stop
10
12
  proxy.stop
13
+
14
+ Nonnative.logger.info "stopped service '#{service.name}'"
11
15
  end
12
16
  end
13
17
  end
@@ -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.99.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.99.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alejandro Falkowski