Skip to content

gh-155781: Hold strong references to sqlite3 converters - #155784

Open
cuishuang wants to merge 1 commit into
python:mainfrom
cuishuang:fix-sqlite-converter-ref-race
Open

gh-155781: Hold strong references to sqlite3 converters#155784
cuishuang wants to merge 1 commit into
python:mainfrom
cuishuang:fix-sqlite-converter-ref-race

Conversation

@cuishuang

Copy link
Copy Markdown
Contributor

Use PyDict_GetItemRef() when looking up registered SQLite converters so the converter remains alive until it has been added to the cursor's row cast map.

Update the caller's reference ownership and add a free-threading regression test that concurrently builds row cast maps and modifies the public converter registry.

Tests:

  • ./python -m test -v test_free_threading.test_sqlite3
  • ./python -m test -v test_sqlite3
  • make patchcheck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant