Skip to content

fix(docker): keep -nogil GIL-free after SQLAlchemy cext (#1398) - #1656

Merged
FabioLeitao merged 4 commits into
mainfrom
fix/1398-nogil-sqlalchemy-cext
Aug 19, 2026
Merged

FabioLeitao merged 4 commits into
mainfrom
fix/1398-nogil-sqlalchemy-cext

Conversation

@FabioLeitao

@FabioLeitao FabioLeitao commented Aug 19, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Isolate DISABLE_SQLALCHEMY_CEXT=1 + --no-binary sqlalchemy to Dockerfile.nogil so the GIL image (latest / 1.7.4.post12, digest sha256:ab8f5dad3e336…) keeps stock cext.
  • Rebuild -nogil with freetds-dev + libkrb5-dev for cp314t pymssql; consume hosted SQL extras wheels (mariadb, oracledb, psycopg2-binary, pymssql) so the next nogil build skips source compile.
  • Release the GIL in FastFilter.filter_batch via py.detach (benefits both images).
  • Add internal --demo timing compare (scan_manifest.duration_minutes) and do not publish -nogil if it does not beat GIL.

Closes #1398

Evidence (this host)

  • Boot + import sqlalchemy: GIL False; 0 sqlalchemy/**/*.so
  • --version / smoke: no SQLAlchemy GIL RuntimeWarning
  • Grype (docker-archive, grype 0.117.0): pass — Medium/Low CPython only (/tmp/grype-nogil-1398.txt)
  • Demo manifest: GIL Hub 0.03 min vs nogil 0.02 min (26 findings). Publish gate eligible; corpus is small (0.01 min resolution).
  • Wheelhouse: 4 cp314t linux_x86_64 wheels uploaded to wheelhouse-x86-64-v1-2026-07-29; SHA256SUMS = 58 wheels. Site index: chore(wheelhouse): PEP 503 simple/ for cp314t SQL extras data-boar-site#86

What we did not do

  • No PYTHON_GIL=0 / -Xgil=0
  • Did not move :latest / Hub 1.7.4.post12
  • Did not publish the local -nogil image (operator review)

Test plan

  • ./scripts/check-all.sh
  • tests/test_docker_image_hardening.py
  • local build-nogil-local.sh AC (GIL after SA, zero .so, smoke, --demo)
  • ./scripts/grype-image-gate.sh docker-archive:/tmp/data_boar-1.7.4.post12-nogil.tar
  • operator: Pages deploy of site#86 then optional Hub -nogil publish

The legacy prefilter loop held the GIL; detach matches RegexStageEngine
and benefits both GIL and -nogil images (#1398 / #551).
…build

Isolate DISABLE_SQLALCHEMY_CEXT to Dockerfile.nogil, add freetds/krb5
for cp314t pymssql, consume hosted SQL extras wheels, and gate publish
on internal demo manifest timing (#1398).
Record that mariadb/oracledb/psycopg2-binary/pymssql free-threaded wheels are for the -nogil image rebuild only, not general install, including the two system packages needed to rebuild them.
@FabioLeitao
FabioLeitao merged commit 750f1fe into main Aug 19, 2026
29 checks passed
@FabioLeitao
FabioLeitao deleted the fix/1398-nogil-sqlalchemy-cext branch August 19, 2026 01:38
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.

[P1][perf][packaging] free-threaded (no-GIL): SQLAlchemy cext religa o GIL e anula o ganho dos outros 18 connectors — medicao e variante sem cext

1 participant