Skip to content

Client timeout causes server crash #724

Open
@f1sherman

Description

@f1sherman

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions