Skip to content

gh-87909: avoid a 0 bytes copy call to sendfile() #101231

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

Closed
wants to merge 1 commit into from

Conversation

gpshead
Copy link
Member

@gpshead gpshead commented Jan 22, 2023

That triggers an EAGAIN error on a minority of kernels and filesystems.

Based on a patch suggestion by pmrv (see the linked issue).

That triggers an EAGAIN error on a minority of kernels and filesystems.
@gpshead gpshead added type-bug An unexpected behavior, bug, or error needs backport to 3.10 only security fixes stdlib Python modules in the Lib dir needs backport to 3.11 only security fixes labels Jan 22, 2023
@gpshead gpshead self-assigned this Jan 22, 2023
@gpshead gpshead marked this pull request as draft January 22, 2023 02:57
@gpshead
Copy link
Member Author

gpshead commented Jan 22, 2023

I turned the old patch on the issue into this PR... it's clearly not right based on existing tests:

test_exception_on_second_call (test.test_shutil.TestZeroCopySendfile.test_exception_on_second_call) ... FAIL
test_small_chunks (test.test_shutil.TestZeroCopySendfile.test_small_chunks) ... FAIL

======================================================================
FAIL: test_exception_on_second_call (test.test_shutil.TestZeroCopySendfile.test_exception_on_second_call)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/cpython/cpython-ro-srcdir/Lib/test/test_shutil.py", line 2565, in test_exception_on_second_call
    with self.assertRaises(OSError) as cm:
AssertionError: OSError not raised

======================================================================
FAIL: test_small_chunks (test.test_shutil.TestZeroCopySendfile.test_small_chunks)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/cpython/cpython-ro-srcdir/Lib/test/test_shutil.py", line 2591, in test_small_chunks
    self.assertEqual(read_file(TESTFN2, binary=True), self.FILEDATA)
AssertionError: b'Qcj[83[886](https://github.com/python/cpython/actions/runs/3977715463/jobs/6819054400#step:17:887)00 chars]vKQMs' != b'Qcj[8388600 chars]vKQMsQcjlcBkZjwawMTZtHYhdRhukiOdKiAFKthzsKfEAa[2097107 chars]KQMs'

----------------------------------------------------------------------
Ran 2 tests in 1.977s

FAILED (failures=2)
test test_shutil failed
1 test failed again:
    test_shutil

@gpshead gpshead removed their assignment Jan 22, 2023
@hugovk hugovk removed the needs backport to 3.10 only security fixes label Apr 7, 2023
@serhiy-storchaka serhiy-storchaka added needs backport to 3.12 only security fixes needs backport to 3.13 bugs and security fixes and removed needs backport to 3.11 only security fixes labels May 9, 2024
@hugovk hugovk removed the needs backport to 3.12 only security fixes label Apr 26, 2025
@hugovk
Copy link
Member

hugovk commented Apr 26, 2025

This old patch didn't work out, shall we close it?

@hugovk hugovk added the pending The issue will be closed if no feedback is provided label Apr 26, 2025
@gpshead gpshead closed this Apr 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting core review DO-NOT-MERGE needs backport to 3.13 bugs and security fixes pending The issue will be closed if no feedback is provided stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants