Skip to content

Conversation

@joshuay03
Copy link
Collaborator

@joshuay03 joshuay03 commented Mar 10, 2024

Description

An oversight on my part in #3283. Puma::Cluster#run constantly checks if all workers have reached their idle timeout even when the feature isn't being used. This change ensures that this check only runs when idle_timeout is configured.

Also includes a micro-optimisation which ensures the idle workers state hash isn't unnecessarily initialised until actually required (either a worker indicates timeout reached via pipe or Puma::Cluster#run checks if all_workers_idle_timed_out?).

All of these changes are covered by existing tests.

Your checklist for this pull request

  • I have reviewed the guidelines for contributing to this repository.
  • I have added (or updated) appropriate tests if this PR fixes a bug or adds a feature.
  • My pull request is 100 lines added/removed or less so that it can be easily reviewed.
  • If this PR doesn't need tests (docs change), I added [ci skip] to the title of the PR.
  • If this closes any issues, I have added "Closes #issue" to the PR description or my commit messages.
  • I have updated the documentation accordingly.
  • All new and existing tests passed, including Rubocop.

@joshuay03 joshuay03 force-pushed the avoid-unnecessary-all-workers-idle-timed-out-check branch from 2b6f85b to eab5ca5 Compare March 10, 2024 06:09
@joshuay03
Copy link
Collaborator Author

joshuay03 commented Mar 11, 2024

Test failures seem to be unrelated.

@dentarg dentarg added the perf label Mar 11, 2024
@dentarg
Copy link
Member

dentarg commented Mar 11, 2024

Indeed: #3342

@dentarg dentarg merged commit 58c31b2 into puma:master Mar 11, 2024
@joshuay03 joshuay03 deleted the avoid-unnecessary-all-workers-idle-timed-out-check branch March 11, 2024 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants