Skip to content

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

Closed
gpshead wants to merge 1 commit into
python:mainfrom
gpshead:gh87909/sendfile-size-tracking
Closed

gh-87909: avoid a 0 bytes copy call to sendfile()#101231
gpshead wants to merge 1 commit into
python:mainfrom
gpshead:gh87909/sendfile-size-tracking

Conversation

@gpshead

@gpsheadgpshead commented Jan 22, 2023

Copy link
Copy Markdown
Member

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.
@gpsheadgpshead added type-bug An unexpected behavior, bug, or error needs backport to 3.10 only security fixes stdlib Standard Library Python modules in the Lib/ directory needs backport to 3.11 only security fixes labels Jan 22, 2023
@gpsheadgpshead self-assigned this Jan 22, 2023
@gpshead
gpshead marked this pull request as draft January 22, 2023 02:57
@gpshead

Copy link
Copy Markdown
MemberAuthor

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

@gpsheadgpshead removed their assignment Jan 22, 2023
@hugovkhugovk removed the needs backport to 3.10 only security fixes label Apr 7, 2023
@serhiy-storchakaserhiy-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
@hugovkhugovk removed the needs backport to 3.12 only security fixes label Apr 26, 2025
@hugovk

Copy link
Copy Markdown
Member

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

@hugovkhugovk added the pending The issue will be closed if no feedback is provided label Apr 26, 2025
@gpsheadgpshead closed this Apr 26, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core reviewDO-NOT-MERGEneeds backport to 3.13bugs and security fixespendingThe issue will be closed if no feedback is providedstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@gpshead@hugovk@serhiy-storchaka@bedevere-bot