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

Client timeout causes server crash #724

Open
f1sherman opened this issue Aug 2, 2024 · 0 comments · May be fixed by #725
Open

Client timeout causes server crash #724

f1sherman opened this issue Aug 2, 2024 · 0 comments · May be fixed by #725

Comments

@f1sherman
Copy link

f1sherman commented Aug 2, 2024

I noticed recently that when a Spring client times out, that it also crashes the server. This appears to be because the server tries to write to the client and gets a Broken pipe error. In this case I would expect the server to remain up. I can reproduce this pretty easily by sending 2 concurrent commands to the Spring server.

Client:

/app/vendor/bundle/ruby/3.3.0/gems/spring-4.2.1/lib/spring/client/run.rb:124:in `verify_server_version': Error connecting to Spring server (RuntimeError)
        from /app/vendor/bundle/ruby/3.3.0/gems/spring-4.2.1/lib/spring/client/run.rb:60:in `run'
        from /app/vendor/bundle/ruby/3.3.0/gems/spring-4.2.1/lib/spring/client/run.rb:40:in `warm_run'
        from /app/vendor/bundle/ruby/3.3.0/gems/spring-4.2.1/lib/spring/client/run.rb:33:in `call'
        from /app/vendor/bundle/ruby/3.3.0/gems/spring-4.2.1/lib/spring/client/command.rb:7:in `call'
        from /app/vendor/bundle/ruby/3.3.0/gems/spring-4.2.1/lib/spring/client/rails.rb:22:in `call'
        from /app/vendor/bundle/ruby/3.3.0/gems/spring-4.2.1/lib/spring/client/command.rb:7:in `call'
        from /app/vendor/bundle/ruby/3.3.0/gems/spring-4.2.1/lib/spring/client.rb:30:in `run'
        from /app/vendor/bundle/ruby/3.3.0/gems/spring-4.2.1/bin/spring:49:in `<top (required)>'

Server:

[2024-08-02 21:13:08 +0000] [1] [application_manager:development] got worker pid 287
[2024-08-02 21:13:08 +0000] [198] [client] got pid: 287
[2024-08-02 21:13:08 +0000] [1] [server] accepted client
[2024-08-02 21:13:08 +0000] [1] [server] shutting down
[2024-08-02 21:13:08 +0000] [1] [application_manager:development] stopping
[2024-08-02 21:13:08 +0000] [207] [application:development] running -> terminating
[2024-08-02 21:13:08 +0000] [207] [application:development] terminating -> exiting
[2024-08-02 21:13:09 +0000] [207] [application:development] 287 exited with 0
[2024-08-02 21:13:09 +0000] [198] [client] got exit status 0
/app/vendor/bundle/ruby/3.3.0/gems/spring-4.2.1/lib/spring/server.rb:57:in `write': Broken pipe (Errno::EPIPE)
        from /app/vendor/bundle/ruby/3.3.0/gems/spring-4.2.1/lib/spring/server.rb:57:in `puts'
        from /app/vendor/bundle/ruby/3.3.0/gems/spring-4.2.1/lib/spring/server.rb:57:in `serve'
f1sherman added a commit to f1sherman/spring that referenced this issue Aug 2, 2024
This fixes an issue where, when the Spring client times out or otherwise
disconnects from the server, that the server crashes with a `Broken pipe
(Errno::EPIPE)` error.
f1sherman added a commit to f1sherman/spring that referenced this issue Aug 2, 2024
This fixes an issue where, when the Spring client times out or otherwise
disconnects from the server, that the server crashes with a `Broken pipe
(Errno::EPIPE)` error.
@f1sherman f1sherman linked a pull request Aug 2, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant