Code Monkey home page Code Monkey logo

Comments (2)

dentarg avatar dentarg commented on May 18, 2024 1

One-liner to reproduce:

$ echo 'app { [200, {}, ["OK"]] }; on_booted { puts "puma booted" }' | ruby -Ilib bin/pumactl --config-file /dev/stdin start
undefined method `on_booted' for nil:NilClass

I guess #2709 never tested with pumactl

Just to be clear, the hook works using puma

$ echo 'app { [200, {}, ["OK"]] }; on_booted { puts "puma booted" }' | ruby -Ilib bin/puma --config /dev/stdin --port 0 --log-requests
Puma starting in single mode...
* Puma version: 6.4.2 (ruby 3.2.3-p157) ("The Eagle of Durango")
*  Min threads: 0
*  Max threads: 5
*  Environment: development
*          PID: 26832
* Listening on http://0.0.0.0:61890
Use Ctrl-C to stop
puma booted
^C- Gracefully stopping, waiting for requests to finish
=== puma shutdown: 2024-03-29 09:46:32 +0100 ===
- Goodbye!

from puma.

dentarg avatar dentarg commented on May 18, 2024 1

Looks like events is missing at

config = Puma::Configuration.new({ config_files: [@config_file] }, {})

as a61b078 added that in several places

However, wouldn't it be better to make events part of the default configuration? Is there anything preventing us from that?

class Configuration
DEFAULTS = {
auto_trim_time: 30,
binds: ['tcp://0.0.0.0:9292'.freeze],
clean_thread_locals: false,
debug: false,
early_hints: nil,
environment: 'development'.freeze,
# Number of seconds to wait until we get the first data for the request.
first_data_timeout: 30,
# Number of seconds to wait until the next request before shutting down.
idle_timeout: nil,
io_selector_backend: :auto,
log_requests: false,
logger: STDOUT,
# How many requests to attempt inline before sending a client back to
# the reactor to be subject to normal ordering. The idea here is that
# we amortize the cost of going back to the reactor for a well behaved
# but very "greedy" client across 10 requests. This prevents a not
# well behaved client from monopolizing the thread forever.
max_fast_inline: 10,
max_threads: Puma.mri? ? 5 : 16,
min_threads: 0,
mode: :http,
mutate_stdout_and_stderr_to_sync_on_write: true,
out_of_band: [],
# Number of seconds for another request within a persistent session.
persistent_timeout: 20,
queue_requests: true,
rackup: 'config.ru'.freeze,
raise_exception_on_sigterm: true,
reaping_time: 1,
remote_address: :socket,
silence_single_worker_warning: false,
silence_fork_callback_warning: false,
tag: File.basename(Dir.getwd),
tcp_host: '0.0.0.0'.freeze,
tcp_port: 9292,
wait_for_less_busy_worker: 0.005,
worker_boot_timeout: 60,
worker_check_interval: 5,
worker_culling_strategy: :youngest,
worker_shutdown_timeout: 30,
worker_timeout: 60,
workers: 0,
http_content_length_limit: nil
}

from puma.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.