Skip to content

Comments

Ensure and enforce that configs are loaded before options are accesse…#8

Open
MitchLewis930 wants to merge 1 commit intopr_058_beforefrom
pr_058_after
Open

Ensure and enforce that configs are loaded before options are accesse…#8
MitchLewis930 wants to merge 1 commit intopr_058_beforefrom
pr_058_after

Conversation

@MitchLewis930
Copy link

@MitchLewis930 MitchLewis930 commented Jan 30, 2026

PR_058


Note

Medium Risk
Touches core boot/configuration and hook execution paths; mistakes could prevent Puma from starting or cause hooks/defaults to behave differently, though changes are largely lifecycle enforcement with updated tests.

Overview
Configuration lifecycle is now enforced. Puma::Configuration#options raises unless clamp has been called, config_files raises unless load has been called, and clamp now implicitly calls load then finalizes defaults.

Config consumers are updated to the new contract. Launcher, ControlCLI, benchmark tooling, Rack handler tests, and other call sites switch from load/direct option mutation to calling clamp and then reading options.

Hook handling is reworked. Fork/cluster-only hooks are stored as structured entries (block/id/cluster_only), warnings about cluster-only hooks in single mode move from the DSL to Configuration#clamp, and lifecycle events are accessed via config.events.

Binder initialization is decoupled from Configuration. Binder now takes an options hash (and uses it for rack env + SSL store extraction), with all call sites updated accordingly.

Written by Cursor Bugbot for commit b16790f. This will update automatically on new commits. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.


@status = :run

log_config if env['PUMA_LOG_CONFIG']
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate warnings printed when clamp called twice

Medium Severity

The clamp method is called twice in Launcher: once in initialize (line 54) and again in run (line 194). Since clamp calls warn_hooks each time without any guard against duplicate execution, cluster-only hook warnings will be printed twice to the console, confusing users with duplicate messages.

Additional Locations (1)

Fix in Cursor Fix in Web

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 this pull request may close these issues.

2 participants