Skip to content

add maxrequestworkers parameter for mpm_worker module #2331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 14, 2022
Merged

add maxrequestworkers parameter for mpm_worker module #2331

merged 4 commits into from
Nov 14, 2022

Conversation

trefzer
Copy link
Contributor

@trefzer trefzer commented Oct 12, 2022

No description provided.

@trefzer trefzer requested a review from a team as a code owner October 12, 2022 07:46
@CLAassistant
Copy link

CLAassistant commented Oct 12, 2022

CLA assistant check
All committers have signed the CLA.

@puppet-community-rangefinder
Copy link

apache::mod::worker is a class

that may have no external impact to Forge modules.

This module is declared in 174 of 579 indexed public Puppetfiles.


These results were generated with Rangefinder, a tool that helps predict the downstream impact of breaking changes to elements used in Puppet modules. You can run this on the command line to get a full report.

Exact matches are those that we can positively identify via namespace and the declaring modules' metadata. Non-namespaced items, such as Puppet 3.x functions, will always be reported as near matches only.

@trefzer
Copy link
Contributor Author

trefzer commented Oct 12, 2022

check seems to fail provisioning SLES-15 which ist not a problem of this commit.

Copy link
Collaborator

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

In other places (prefork/event mpm) we prefer MaxRequestWorkers and don't output MaxClients if it's set. Could you implement the same here?

@trefzer
Copy link
Contributor Author

trefzer commented Oct 30, 2022

check seems to fail provisioning RedHat 7 and 9, not the change request.

@david22swan
Copy link
Member

@ekohl Are you happy with the changes made?

Copy link
Collaborator

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

The changes look good, but spec/classes/mod/worker_spec.rb should be updated to pass maxrequestworkers and verify it outputs MaxRequestWorkers and not MaxClients.

@@ -126,7 +126,8 @@
it { is_expected.to contain_file('/etc/httpd/conf.modules.d/worker.conf').with(content: %r{^<IfModule mpm_worker_module>$}) }
it { is_expected.to contain_file('/etc/httpd/conf.modules.d/worker.conf').with(content: %r{^\s+ServerLimit\s+10$}) }
it { is_expected.to contain_file('/etc/httpd/conf.modules.d/worker.conf').with(content: %r{^\s+StartServers\s+11$}) }
it { is_expected.to contain_file('/etc/httpd/conf.modules.d/worker.conf').with(content: %r{^\s+MaxClients\s+12$}) }
it { is_expected.not_to contain_file('/etc/httpd/conf.modules.d/worker.conf').with(content: %r{^\s+MaxClients}) }
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's better to expect a file to be there without certain content. The big reason is that your example will also pass if the file isn't present in the catalog at all.

Suggested change
it { is_expected.not_to contain_file('/etc/httpd/conf.modules.d/worker.conf').with(content: %r{^\s+MaxClients}) }
it { is_expected.to contain_file('/etc/httpd/conf.modules.d/worker.conf').without(content: %r{MaxClients}) }

On a side note: this whole file should be rewritten IMHO to have a single it statement with one long content block that has the full generated template, but that's not part of this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ack done

@@ -8,6 +8,7 @@
# The max number of simultaneous requests that will be served.
# This is the old name and is still supported. The new name is
# MaxRequestWorkers as of 2.3.13.
# If maxreuestworkers is set, this value is ignored.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# If maxreuestworkers is set, this value is ignored.
# If maxrequestworkers is set, this value is ignored.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ack done

Copy link
Member

@david22swan david22swan left a comment

Choose a reason for hiding this comment

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

Little concerned with maxclients no longer having a test where it is explicitly set, but given it has a default value covered in the other tests this should be fine.

LGTM

@ekohl Are you happy that the changes that you requested have been implemented?

Copy link
Collaborator

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

One tiny comment, but generally 👍

@@ -40,6 +41,10 @@
# @param apache_version
# Used to verify that the Apache version you have requested is compatible with the module.
#
# @param maxrequestworkers
# Maximum number of connections that will be processed simultaneously
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this will show up slightly better in the rendered strings documentation

Suggested change
# Maximum number of connections that will be processed simultaneously
# Maximum number of connections that will be processed simultaneously.

@david22swan
Copy link
Member

Gonna go ahead and merge.
@trefzer Thanks for putting in the work.
@ekohl Thanks for helping to review

@david22swan david22swan merged commit 0cb1c07 into puppetlabs:main Nov 14, 2022
@ekohl ekohl mentioned this pull request Dec 14, 2022
@trefzer trefzer deleted the fix_maxrequestworkers branch April 6, 2024 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants