rble 0.7.0 → 0.7.1

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: 90ba04b80efe39ebb30779c0b4fd137e17b5f29bf472055809eecfbe21f3df6c
4
- data.tar.gz: 8f1e6a6d96be903b4d6a781441e7e2d7d074321a15454a45c26757bcf0223f2d
3
+ metadata.gz: 165040590e18912fc264dc9d5fb25817116614deb780d75a192d0b15ce46a9fd
4
+ data.tar.gz: bde8c6496c126291b0522ba0894c7f46f8120490d19f4630c9a7625560bc4679
5
5
  SHA512:
6
- metadata.gz: '07045286c9f44415feb3107897dca6f35a759259e2c30bab0939f93bb671afdef840d2648b0a72bc837c5d461f4e867ea484604bdfc1452a334b23c4eba6dde8'
7
- data.tar.gz: 2f0568cb218fde698e8e98f5cf8bacf9adf3e5f1438189d9fe0f554c537198bbd9b07743d1cabfe783259a66160cedb01bb662d07a48f989f4c49b268c11fb77
6
+ metadata.gz: 5220dc4ee666bc14fbb1796360cea2954602e07e527d07b3fa7c3bed75606c01469b23efc5d5d02c1181167d677170feaa97008547646d681b5a30f4e27cb045
7
+ data.tar.gz: 5f0140fb9aaa74f4959c560ec1e51266dc7c2f131e89e05fd9b7538e7c6ef115854986499b470d7325a37a3abb699285136a45b0c0e1957033b59778155d066f
data/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [0.7.1] - 2026-03-18
6
+
7
+ ### Fixed
8
+
9
+ - **`at_exit` hook hangs CI** — Per-instance `at_exit { cleanup_all_connections }` in backend initializers caused process hang at exit when the singleton was reset during test teardown. Moved to a single class-level hook in `Backend` that reads the current singleton at exit time (no-op after `Backend.reset!`) with a 5-second thread timeout.
10
+ - **CI timeout** — Added `timeout-minutes: 10` to CI workflow as a safety net.
11
+
5
12
  ## [0.7.0] - 2026-03-17
6
13
 
7
14
  ### Fixed (Critical)
@@ -31,8 +31,6 @@ module RBLE
31
31
  # (D-Bus signal handlers run on rble-dbus-loop thread, user code on main thread)
32
32
  @state_mutex = Mutex.new
33
33
 
34
- # Best-effort cleanup on process exit
35
- at_exit { cleanup_all_connections }
36
34
  end
37
35
 
38
36
  # Start scanning for BLE devices
@@ -40,8 +40,6 @@ module RBLE
40
40
  # (event_processor_thread and user thread)
41
41
  @state_mutex = Mutex.new
42
42
 
43
- # Best-effort cleanup on process exit
44
- at_exit { cleanup_all_connections }
45
43
  end
46
44
 
47
45
  # Start the subprocess if not running
data/lib/rble/backend.rb CHANGED
@@ -155,10 +155,30 @@ module RBLE
155
155
  ensure_backend_selected
156
156
  @backend_instance ||= load_backend(@backend_symbol)
157
157
  @backend_frozen = true
158
+ register_exit_cleanup unless @exit_cleanup_registered
158
159
  @backend_instance
159
160
  end
160
161
  end
161
162
 
163
+ # Register a single at_exit hook for best-effort connection cleanup.
164
+ # Reads the current singleton at exit time so that Backend.reset!
165
+ # (used in test teardown) makes this a no-op.
166
+ def register_exit_cleanup
167
+ @exit_cleanup_registered = true
168
+ at_exit do
169
+ instance = @backend_mutex.synchronize { @backend_instance }
170
+ next unless instance
171
+
172
+ cleanup = Thread.new do
173
+ instance.send(:cleanup_all_connections)
174
+ rescue StandardError
175
+ # best-effort
176
+ end
177
+ cleanup.join(5)
178
+ cleanup.kill if cleanup.alive?
179
+ end
180
+ end
181
+
162
182
  # Create backend instance
163
183
  # @param sym [Symbol] Backend symbol
164
184
  # @return [Backend::Base] Backend instance
data/lib/rble/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RBLE
4
- VERSION = '0.7.0'
4
+ VERSION = '0.7.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rble
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Tehler