GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — BUG: make SeedSequence.spawn thread safe (#32889) by charris · Pull Request #33225 · numpy/numpy

Conversation

@charris

@charris charris commented Nov 5, 2026

Copy link
Copy Markdown
Member

Backport of #32889.

PR summary

SeedSequence.spawn has a bug described in gh-32063 because of which multiple threads spawning from the same SeedSequence can observe same starting index and hence return children with identical spawn keys. This PR fixes that by introducing a lock as part of SeedSequence class. To preserve pickling of SeedSequence objects I have implemented a __reduce_ex__ function in its class which serialized the logical state without the lock.

First time contributor introduction

I am here to contribute as part of the NumFOCUS Volunteer Sprints Fall 2026 cohort. I recently got some of my contributions merged in (https://github.com/numpy/numpy/pulls?q=is%3Apr+state%3Aclosed+author%3Ashbhmbnsl1).

AI Disclosure

I used AI (OpenAI Codex specifically GPT-5.6-Sol) to get deeper understanding of the issue and how SeedSequence.spawn works internally. I also used it to suggest test case to test the duplicate spawning key using multi-threads.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@shbhmbnsl1 @charris
BUG: make SeedSequence.spawn thread safe (numpy#32889)
6135947
@charris charris added this to the 2.5.5 release milestone Nov 5, 2026
@charris charris added 00 - Bug 08 - Backport Used to tag backport PRs sustain-2026 Issues reserved for NumFOCUS Sustaining Open Source Series 2026 labels Nov 5, 2026
@charris charris closed this Nov 6, 2026
@charris charris reopened this Nov 6, 2026
@charris
charris merged commit dc5436c into numpy:maintenance/2.5.x Nov 6, 2026
169 of 174 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@charris
charris deleted the backport-32889 branch November 6, 2026 03:01
@charris charris mentioned this pull request Nov 9, 2026
REV: "BUG: make SeedSequence.spawn thread safe (#32889)" #33265
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

00 - Bug 08 - Backport Used to tag backport PRs sustain-2026 Issues reserved for NumFOCUS Sustaining Open Source Series 2026

Projects

None yet

Milestone

2.5.5 release

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@charris @shbhmbnsl1
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.