Skip to content

[3.15] gh-155811: Add a seqcount to gc_stats to prevent torn reads (GH-155828) - #158829

Merged
pablogsal merged 1 commit into
python:3.15from
maurycy:backport-5fecd44-3.15
Oct 5, 2026
Merged

pablogsal merged 1 commit into
python:3.15from
maurycy:backport-5fecd44-3.15

Conversation

@maurycy

@maurycy maurycy commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Manual backport of #155828, @miss-islington hit a conflict in #155828 (comment)

3.15 does not have stats_mutex (#151766 wasn't backported), so the sequence counter update there is applied without the PyMutex_Lock()/PyMutex_Unlock() pair. The rest went fine.

(cherry picked from commit 5fecd44)

Disclosure: used Claude Fable 5.1 to apply it (mere bookkeeping.)

Co-authored-by: Pablo Galindo Salgado <[email protected]>

…reads (pythonGH-155828)

* update_seq

* no need for XCHGL, MOVL is enough?

* pythongh-155811: Retry an inconsistent GC snapshot once

---------
(cherry picked from commit 5fecd44)

Co-authored-by: Pablo Galindo Salgado <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
@maurycy

maurycy commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor Author

@sergey-miryanov @hugovk My first backport; apologies if I've missed something. Left as draft, since it's waiting for 3.15.1

@maurycy maurycy changed the title [3.15] gh-155811: Add a seqcount to gc_stats to prevent torn reads (GH-155828) [3.15.1] gh-155811: Add a seqcount to gc_stats to prevent torn reads (GH-155828) Oct 5, 2026
@maurycy
maurycy marked this pull request as draft October 5, 2026 08:23
@sergey-miryanov

Copy link
Copy Markdown
Contributor

Title should by [3.15], not [3.15.1]. Otherwise looks good to me.

@maurycy maurycy changed the title [3.15.1] gh-155811: Add a seqcount to gc_stats to prevent torn reads (GH-155828) [3.15] gh-155811: Add a seqcount to gc_stats to prevent torn reads (GH-155828) Oct 5, 2026

@pablogsal pablogsal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@pablogsal
pablogsal marked this pull request as ready for review October 5, 2026 09:21
@pablogsal
pablogsal merged commit 0281240 into python:3.15 Oct 5, 2026
59 checks passed
@maurycy
maurycy deleted the backport-5fecd44-3.15 branch October 5, 2026 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants