diff --git a/CHANGELOG.md b/CHANGELOG.md index ccacc975..cc3c783f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## Next Release +* Fix reloading issue in Ruby 3.3. + ## 4.2.1 * Added `Spring.connect_timeout` and `Spring.boot_timeout` to allow to increase timeout for larger apps. diff --git a/lib/spring/application_manager.rb b/lib/spring/application_manager.rb index 34c14dac..6ac016d8 100644 --- a/lib/spring/application_manager.rb +++ b/lib/spring/application_manager.rb @@ -126,7 +126,8 @@ def start_wait_thread(pid, child) # as if it does we're no longer interested in the child loop do IO.select([child]) - break if child.recv(1, Socket::MSG_PEEK).empty? + peek = child.recv(1, Socket::MSG_PEEK) + break if peek.nil? || peek.empty? sleep 0.01 end diff --git a/test/support/acceptance_test.rb b/test/support/acceptance_test.rb index 3c47923f..5035bf7f 100644 --- a/test/support/acceptance_test.rb +++ b/test/support/acceptance_test.rb @@ -189,7 +189,7 @@ def self.omg app.insert_into_test "Foo.omg" app.await_reload - assert_failure app.spring_test_command, stdout: "RuntimeError: omg" + assert_failure app.spring_test_command, stdout: "RuntimeError: omg", log: /child \d+ shutdown/ end test "app gets reloaded even with a ton of boot output" do