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

Allow timeout to work when reading with nowait (#5854) #7292

Conversation

Dreamsorcerer
Copy link
Member

(Note this depends on and extends #5853)

When reading in a loop while the buffer is being constantly filled, the timeout does not work as there are no calls to _wait() where the timer is used.

I don't know if this edge case is enough to be worried about, but have put together an initial attempt at fixing it.
I'm not sure if this is really the right solution, but can atleast be used as as a discussion on ways to improve this.

This can't be backported as this changes the public API (one of the functions is now async).

Related #5851.


Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
(cherry picked from commit 80e2bde)

What do these changes do?

Are there changes in behavior for the user?

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."

(Note this depends on and extends #5853)

When reading in a loop while the buffer is being constantly filled, the
timeout does not work as there are no calls to `_wait()` where the timer
is used.

I don't know if this edge case is enough to be worried about, but have
put together an initial attempt at fixing it.
I'm not sure if this is really the right solution, but can atleast be
used as as a discussion on ways to improve this.

This can't be backported as this changes the public API (one of the
functions is now async).

Related #5851.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
(cherry picked from commit 80e2bde)
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label May 16, 2023
@codecov
Copy link

codecov bot commented May 16, 2023

Codecov Report

Merging #7292 (d63db86) into 3.9 (64594af) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##              3.9    #7292   +/-   ##
=======================================
  Coverage   97.31%   97.31%           
=======================================
  Files         108      108           
  Lines       31664    31683   +19     
  Branches     4025     4028    +3     
=======================================
+ Hits        30813    30832   +19     
  Misses        645      645           
  Partials      206      206           
Flag Coverage Δ
CI-GHA 97.21% <100.00%> (+<0.01%) ⬆️
OS-Linux 96.89% <100.00%> (+<0.01%) ⬆️
OS-Windows 94.52% <100.00%> (+<0.01%) ⬆️
OS-macOS 96.48% <100.00%> (+<0.01%) ⬆️
Py-3.10.11 96.96% <100.00%> (+<0.01%) ⬆️
Py-3.11.0 96.41% <100.00%> (+<0.01%) ⬆️
Py-3.7.16 96.69% <100.00%> (+<0.01%) ⬆️
Py-3.7.9 94.36% <100.00%> (+<0.01%) ⬆️
Py-3.8.10 94.30% <100.00%> (+<0.01%) ⬆️
Py-3.8.16 96.49% <100.00%> (-0.11%) ⬇️
Py-3.9.13 94.30% <96.00%> (+<0.01%) ⬆️
Py-3.9.16 96.64% <96.00%> (-0.01%) ⬇️
Py-pypy7.3.11 94.03% <100.00%> (+<0.01%) ⬆️
VM-macos 96.48% <100.00%> (+<0.01%) ⬆️
VM-ubuntu 96.89% <100.00%> (+<0.01%) ⬆️
VM-windows 94.52% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
aiohttp/helpers.py 95.11% <100.00%> (+0.02%) ⬆️
aiohttp/streams.py 97.73% <100.00%> (-0.01%) ⬇️
tests/test_client_functional.py 98.49% <100.00%> (+0.01%) ⬆️

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

@Dreamsorcerer Dreamsorcerer merged commit 0f8f565 into 3.9 May 16, 2023
@Dreamsorcerer Dreamsorcerer deleted the patchback/backports/3.9/80e2bde149e12754e8caa9d5380f960e16f7b9e3/pr-5854 branch May 16, 2023 16:55
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.

1 participant