Skip to content

Puma::CLI deletes options before Puma::Cluster tries to use them #769

@dovestyle

Description

@dovestyle

It seems Puma::CLI.write_state removes a bunch of keys from Runner's @options hash right before Puma::Cluster.spawn_workers is called. I notice the @config.dup being called to output the state without affecting the actual, "stateful" @options, but I think ruby is doing it anyway. It's a weird issue. I am doing a simple 'pp @options' before and after the call to write_state, and the keys being removed from the duped hash are also being removed from the stateful hash. My investigation started with this error:

gems/puma-2.13.2/lib/puma/cluster.rb:107:in `block in spawn_workers': undefined method `each' for nil:NilClass (NoMethodError)
    from gems/puma-2.13.2/lib/puma/cluster.rb:105:in `times'
    from gems/puma-2.13.2/lib/puma/cluster.rb:105:in `spawn_workers'
    from gems/puma-2.13.2/lib/puma/cluster.rb:386:in `run'
    from gems/puma-2.13.2/lib/puma/cli.rb:218:in `run'
    from gems/puma-2.13.2/bin/puma:10:in `<top (required)>'
    from bin/puma:23:in `load'
    from bin/puma:23:in `<main>'
    from bin/ruby_executable_hooks:15:in `eval'
    from bin/ruby_executable_hooks:15:in `<main>'

The @options hash has been stripped of the keys that spawn_workers is trying to use.

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