Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix reloading in Ruby 3.3 #730

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
3 changes: 2 additions & 1 deletion lib/spring/application_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion test/support/acceptance_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading