GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||
GeezerVison is showing github.com — gh-151640: Track sharing of BytesIO buffer in free-threaded builds by pedramkarimii · Pull Request #151651 · python/cpython Conversation
|
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Additional context: This PR is intended to fix the specific While investigating the code path, I also found that The chosen fix is intentionally conservative: in free-threaded builds, avoid returning the internal I also considered fixing this lower in the resize/shared-buffer ownership path, but that seemed more invasive because it would require changing the interaction between |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
b26fbb8 to
33bc6c8
Compare
|
I think always copying |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Keep zero-copy whole-buffer reads, but detach to a private buffer before a later write can mutate or resize an exposed BytesIO buffer.
33bc6c8 to
367b372
Compare
|
@nascheme Thanks for the prototype. I reworked the PR to follow the shared-buffer flag / copy-on-write approach, rather than always copying the buffer in free-threaded builds. The update includes the concurrent regression test and the NEWS entry. All CI checks are now green. Local validation also included free-threaded Py_DEBUG/refleak and the targeted free-threaded ThreadSanitizer regression: 10/10 passes with no diagnostics. The updated commit is 367b372. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I'll let @ZeroIntensity take a look too but I think this can be merged. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thanks @pedramkarimii for the PR, and @ZeroIntensity for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, @pedramkarimii and @ZeroIntensity, I could not cleanly backport this to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, @pedramkarimii and @ZeroIntensity, I could not cleanly backport this to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-153151 is a backport of this pull request to the 3.15 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-153153 is a backport of this pull request to the 3.14 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…builds (GH-151651) (gh-153151) (cherry picked from commit 881a13a) Remove peek() call from backported test, not in Python 3.15. Co-authored-by: Pedram Karimi <[email protected]> Co-authored-by: Neil Schemenauer <[email protected]>
…builds (GH-151651) (gh-153153) (cherry picked from commit 881a13a) Remove peek() call and call BytesIO class directly, fixes test for Python 3.14. Co-authored-by: Pedram Karimi <[email protected]> Co-authored-by: Neil Schemenauer <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.