Skip to content
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

Fix GunicornWebWorker max_requests_jitter not work #7518

Merged
merged 1 commit into from
Aug 12, 2023

Conversation

phyng
Copy link
Contributor

@phyng phyng commented Aug 12, 2023

What do these changes do?

GunicornWebWorker use self.cfg.max_requests which is not add jitter, from https://github.com/benoitc/gunicorn/blob/master/gunicorn/workers/base.py#L56-L60, the correct way is to use sef.max_requests

Are there changes in behavior for the user?

After the PR is merged, the max-requests-jitter parameter of Gunicorn can take effect.

Related issue number

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> for example (588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the pr
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."

@phyng phyng requested a review from asvetlov as a code owner August 12, 2023 09:03
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Aug 12, 2023
@Dreamsorcerer
Copy link
Member

Appears to break some tests, so will need updating.

@codecov
Copy link

codecov bot commented Aug 12, 2023

Codecov Report

Merging #7518 (1797a28) into master (e481c05) will not change coverage.
The diff coverage is 66.66%.

@@           Coverage Diff           @@
##           master    #7518   +/-   ##
=======================================
  Coverage   97.34%   97.34%           
=======================================
  Files         106      106           
  Lines       31433    31433           
  Branches     3571     3571           
=======================================
  Hits        30600    30600           
  Misses        630      630           
  Partials      203      203           
Flag Coverage Δ
CI-GHA 97.29% <66.66%> (ø)
OS-Linux 96.96% <66.66%> (ø)
OS-Windows 95.42% <0.00%> (ø)
OS-macOS 96.64% <66.66%> (ø)
Py-3.10.11 95.34% <0.00%> (ø)
Py-3.10.12 96.85% <66.66%> (ø)
Py-3.11.4 96.55% <66.66%> (ø)
Py-3.8.10 95.31% <0.00%> (ø)
Py-3.8.17 96.79% <66.66%> (ø)
Py-3.9.13 95.31% <0.00%> (ø)
Py-3.9.17 96.81% <66.66%> (ø)
Py-pypy7.3.11 96.35% <66.66%> (+<0.01%) ⬆️
VM-macos 96.64% <66.66%> (ø)
VM-ubuntu 96.96% <66.66%> (ø)
VM-windows 95.42% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
aiohttp/worker.py 91.86% <0.00%> (ø)
tests/test_worker.py 98.94% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Dreamsorcerer Dreamsorcerer merged commit 8bd42e7 into aio-libs:master Aug 12, 2023
26 of 32 checks passed
@patchback
Copy link
Contributor

patchback bot commented Aug 12, 2023

Backport to 3.8: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.8/8bd42e742acc825e8b2f170c04216da3c767f56e/pr-7518

Backported as #7519

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Aug 12, 2023
`GunicornWebWorker` use `self.cfg.max_requests` which is not add jitter,
from
https://github.com/benoitc/gunicorn/blob/master/gunicorn/workers/base.py#L56-L60,
the correct way is to use `sef.max_requests`

(cherry picked from commit 8bd42e7)
@patchback
Copy link
Contributor

patchback bot commented Aug 12, 2023

Backport to 3.9: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.9/8bd42e742acc825e8b2f170c04216da3c767f56e/pr-7518

Backported as #7520

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Aug 12, 2023
`GunicornWebWorker` use `self.cfg.max_requests` which is not add jitter,
from
https://github.com/benoitc/gunicorn/blob/master/gunicorn/workers/base.py#L56-L60,
the correct way is to use `sef.max_requests`

(cherry picked from commit 8bd42e7)
Dreamsorcerer pushed a commit that referenced this pull request Aug 12, 2023
…jitter not work (#7520)

**This is a backport of PR #7518 as merged into master
(8bd42e7).**

<!-- Thank you for your contribution! -->

## What do these changes do?

<!-- Please give a short brief about these changes. -->

`GunicornWebWorker` use `self.cfg.max_requests` which is not add jitter,
from
https://github.com/benoitc/gunicorn/blob/master/gunicorn/workers/base.py#L56-L60,
the correct way is to use `sef.max_requests`

## Are there changes in behavior for the user?

<!-- Outline any notable behaviour for the end users. -->

After the PR is merged, the max-requests-jitter parameter of Gunicorn
can take effect.

## Related issue number

<!-- Are there any issues opened that will be resolved by merging this
change? -->

## Checklist

- [x] I think the code is well written
- [x] Unit tests for the changes exist
- [ ] Documentation reflects the changes
- [ ] If you provide code modification, please add yourself to
`CONTRIBUTORS.txt`
  * The format is &lt;Name&gt; &lt;Surname&gt;.
  * Please keep alphabetical order, the file is sorted by names.
- [x] Add a new news fragment into the `CHANGES` folder
  * name it `<issue_id>.<type>` for example (588.bugfix)
* if you don't have an `issue_id` change it to the pr id after creating
the pr
  * ensure type is one of the following:
    * `.feature`: Signifying a new feature.
    * `.bugfix`: Signifying a bug fix.
    * `.doc`: Signifying a documentation improvement.
    * `.removal`: Signifying a deprecation or removal of public API.
* `.misc`: A ticket has been closed, but it is not of interest to users.
* Make sure to use full sentences with correct case and punctuation, for
example: "Fix issue with non-ascii contents in doctest text files."

Co-authored-by: phyng <phyngk@gmail.com>
Dreamsorcerer pushed a commit that referenced this pull request Aug 12, 2023
…jitter not work (#7519)

**This is a backport of PR #7518 as merged into master
(8bd42e7).**

<!-- Thank you for your contribution! -->

## What do these changes do?

<!-- Please give a short brief about these changes. -->

`GunicornWebWorker` use `self.cfg.max_requests` which is not add jitter,
from
https://github.com/benoitc/gunicorn/blob/master/gunicorn/workers/base.py#L56-L60,
the correct way is to use `sef.max_requests`

## Are there changes in behavior for the user?

<!-- Outline any notable behaviour for the end users. -->

After the PR is merged, the max-requests-jitter parameter of Gunicorn
can take effect.

## Related issue number

<!-- Are there any issues opened that will be resolved by merging this
change? -->

## Checklist

- [x] I think the code is well written
- [x] Unit tests for the changes exist
- [ ] Documentation reflects the changes
- [ ] If you provide code modification, please add yourself to
`CONTRIBUTORS.txt`
  * The format is &lt;Name&gt; &lt;Surname&gt;.
  * Please keep alphabetical order, the file is sorted by names.
- [x] Add a new news fragment into the `CHANGES` folder
  * name it `<issue_id>.<type>` for example (588.bugfix)
* if you don't have an `issue_id` change it to the pr id after creating
the pr
  * ensure type is one of the following:
    * `.feature`: Signifying a new feature.
    * `.bugfix`: Signifying a bug fix.
    * `.doc`: Signifying a documentation improvement.
    * `.removal`: Signifying a deprecation or removal of public API.
* `.misc`: A ticket has been closed, but it is not of interest to users.
* Make sure to use full sentences with correct case and punctuation, for
example: "Fix issue with non-ascii contents in doctest text files."

Co-authored-by: phyng <phyngk@gmail.com>
renovate bot referenced this pull request in allenporter/pyrainbird Oct 9, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [aiohttp](https://togithub.com/aio-libs/aiohttp) | `==3.8.5` ->
`==3.8.6` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/aiohttp/3.8.6?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/aiohttp/3.8.6?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/aiohttp/3.8.5/3.8.6?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/aiohttp/3.8.5/3.8.6?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>aio-libs/aiohttp (aiohttp)</summary>

###
[`v3.8.6`](https://togithub.com/aio-libs/aiohttp/blob/HEAD/CHANGES.rst#386-2023-10-07)

[Compare
Source](https://togithub.com/aio-libs/aiohttp/compare/v3.8.5...v3.8.6)

\==================

## Security bugfixes

- Upgraded the vendored copy of llhttp\_ to v9.1.3 -- by
:user:`Dreamsorcerer`

    Thanks to :user:`kenballus` for reporting this, see

GHSA-pjjw-qhg8-p2p9.

    .. \_llhttp: https://llhttp.org

    `#&#8203;7647 <https://github.com/aio-libs/aiohttp/issues/7647>`\_

- Updated Python parser to comply with RFCs 9110/9112 -- by
:user:`Dreamorcerer`

    Thanks to :user:`kenballus` for reporting this, see

GHSA-gfw2-4jvh-wgfg.

    `#&#8203;7663 <https://github.com/aio-libs/aiohttp/issues/7663>`\_

## Deprecation

- Added `fallback_charset_resolver` parameter in `ClientSession` to
allow a user-supplied
    character set detection function.

Character set detection will no longer be included in 3.9 as a default.
If this feature is needed,
please use `fallback_charset_resolver
<https://docs.aiohttp.org/en/stable/client_advanced.html#character-set-detection>`\_.

    `#&#8203;7561 <https://github.com/aio-libs/aiohttp/issues/7561>`\_

## Features

- Enabled lenient response parsing for more flexible parsing in the
client
(this should resolve some regressions when dealing with badly formatted
HTTP responses). -- by :user:`Dreamsorcerer`

    `#&#8203;7490 <https://github.com/aio-libs/aiohttp/issues/7490>`\_

## Bugfixes

- Fixed `PermissionError` when `.netrc` is unreadable due to
permissions.

    `#&#8203;7237 <https://github.com/aio-libs/aiohttp/issues/7237>`\_

- Fixed output of parsing errors pointing to a `\n`. -- by
:user:`Dreamsorcerer`

    `#&#8203;7468 <https://github.com/aio-libs/aiohttp/issues/7468>`\_

-   Fixed `GunicornWebWorker` max_requests_jitter not working.

    `#&#8203;7518 <https://github.com/aio-libs/aiohttp/issues/7518>`\_

- Fixed sorting in `filter_cookies` to use cookie with longest path. --
by :user:`marq24`.

    `#&#8203;7577 <https://github.com/aio-libs/aiohttp/issues/7577>`\_

- Fixed display of `BadStatusLine` messages from llhttp\_. -- by
:user:`Dreamsorcerer`

    `#&#8203;7651 <https://github.com/aio-libs/aiohttp/issues/7651>`\_

***

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/allenporter/pyrainbird).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4wLjMiLCJ1cGRhdGVkSW5WZXIiOiIzNy4wLjMiLCJ0YXJnZXRCcmFuY2giOiJtYWluIn0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot:chronographer:provided There is a change note present in this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants