Skip to content

Commit 457416d

Browse files
authoredJan 23, 2025
Merge pull request #730 from thomasmarshall/fix-restart
Fix reloading in Ruby 3.3
2 parents 4bdb337 + 4105015 commit 457416d

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed
 

‎CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## Next Release
22

3+
* Fix reloading issue in Ruby 3.3.
4+
35
## 4.2.1
46

57
* Added `Spring.connect_timeout` and `Spring.boot_timeout` to allow to increase timeout for larger apps.

‎lib/spring/application_manager.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ def start_wait_thread(pid, child)
126126
# as if it does we're no longer interested in the child
127127
loop do
128128
IO.select([child])
129-
break if child.recv(1, Socket::MSG_PEEK).empty?
129+
peek = child.recv(1, Socket::MSG_PEEK)
130+
break if peek.nil? || peek.empty?
130131
sleep 0.01
131132
end
132133

‎test/support/acceptance_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def self.omg
189189
app.insert_into_test "Foo.omg"
190190

191191
app.await_reload
192-
assert_failure app.spring_test_command, stdout: "RuntimeError: omg"
192+
assert_failure app.spring_test_command, stdout: "RuntimeError: omg", log: /child \d+ shutdown/
193193
end
194194

195195
test "app gets reloaded even with a ton of boot output" do

0 commit comments

Comments
 (0)
Failed to load comments.