Skip to content

RowCore GC support, weak subclass cache, docs fixes (r5 F4, F16, F18) - #19

Open
dominikpeter wants to merge 1 commit into
mainfrom
fix/r5-rowcore
Open

dominikpeter wants to merge 1 commit into
mainfrom
fix/r5-rowcore

Conversation

@dominikpeter

Copy link
Copy Markdown
Member

F4 - verified, fixed

RowCore held five Py fields with no traverse/clear; a row referenced from its own values/cursor/maps was never collected (weakref stayed alive after gc.collect()). Fix: traverse visits all five fields, clear replaces them with None. Added to the existing #[pymethods] block (no multiple-pymethods feature). PyO3 already visits the instance dict; the cfg-guarded _PyObject_GenericGetAttrWithDict code is untouched. Test: tests/common_issues/test_rowcore_gc.py (failed before, passes now).
Cost: GC-tracked rows are slightly slower to allocate (release build, ns): make_row_fast 108 -> 124, construct_rows 60 -> 80 per row.

F16 - verified, fixed (leak)

PLAIN_TYPES held strong refs to every verified subclass forever (a dynamically created Row subclass was never freed). Now holds weakrefs (dead ones pruned on insert); lookup stays a short list scan. make_row_fast 108 -> 124 ns total with F4. Not changed: a field descriptor added to a class after its first row is still not noticed (a recheck on every call cost ~700 ns per make_row_fast); documented in the code comment. Test: test_verified_subclass_is_not_kept_alive and test_override_in_subclass_body_is_honoured.

F18 - fixed (docs)

ARCHITECTURE.md error section now describes Rust raising (src/errors.rs, DDBCRaiseFor); PYTHON_LAYER_CHANGES.md gains RowCore (PR #4) and Rust error-dispatch (PR #8) sections; Row in row.py is marked RUST-PORT; PLATFORMS_AND_CONNECTION.md lists SqlPassword, ActiveDirectoryPassword and ServicePrincipal as supported, and only ActiveDirectoryIntegrated/WorkloadIdentity/NTLM as unsupported (checked against src/connstr.rs). CHANGELOG Unreleased entry added.

Tests: tests/port and tests/common_issues (incl. new test_rowcore_gc.py) with run_tests.py: all green.

🤖 Generated with Claude Code

…(r5 F4, F16, F18)

Co-Authored-By: Claude <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant