mirror of
https://github.com/simonw/datasette.git
synced 2026-10-19 07:47:00 +02:00
Read path: the leased pool replaces the thread-local cache. Pooled connections record Database._conn_generation when opened; a stale one is discarded on checkout or return, and _invalidate_connections() (called by the SchemaWatcher on a replaced/deleted file) closes that database's idle connections at once. Leased ones are only ever closed by their own thread on release. Write path: the idle-exit write thread keeps its lock protocol; its connection lives in a _WriteConnection holder that is reopened when the generation moves, before the next task. Post-write schema_version check and _after_write catalog await are kept for every write API in both modes. Non-threaded write connections are reopened on a generation change and never cached half-prepared. Deleted files: write connections use mode=rw once Datasette has seen the file exist (_file_seen), so a deleted file is never silently recreated, while a database added before its file exists is still created by its first write. Settings: max_open_connections (clamped to >= 4 x num_sql_threads), connection_idle_timeout_ms (30000, read connections and write threads), schema_watch_interval_ms, default_schema_watch (external|owned). The spike-only knobs (connection_idle_timeout, connection_pool_wait_ms, pool_read_connections, write_thread_idle_timeout_ms) are gone, along with the pool's wait/disable code paths. The reaper falls back to checkout-time reaping where threads cannot be started (Pyodide). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EwkLo2rJWidpkDVT3HkvNv |
||
|---|---|---|
| .. | ||
| _static | ||
| _templates | ||
| images | ||
| shots | ||
| .gitignore | ||
| authentication.rst | ||
| auto-build.sh | ||
| binary_data.rst | ||
| changelog.rst | ||
| cli-reference.rst | ||
| codespell-ignore-words.txt | ||
| conf.py | ||
| configuration.rst | ||
| contributing.rst | ||
| csv_export.rst | ||
| custom_templates.rst | ||
| datasette-0.51.png | ||
| datasette-logo.svg | ||
| deploying.rst | ||
| ecosystem.rst | ||
| events.md | ||
| facets.rst | ||
| full_text_search.rst | ||
| getting_started.rst | ||
| index.rst | ||
| installation.rst | ||
| internals.rst | ||
| introspection.rst | ||
| javascript_plugins.rst | ||
| json_api.rst | ||
| json_api_doc.py | ||
| Makefile | ||
| metadata.rst | ||
| metadata_doc.py | ||
| pages.rst | ||
| performance.rst | ||
| plugin_hooks.rst | ||
| plugin_telemetry.rst | ||
| plugins.rst | ||
| publish.rst | ||
| settings.rst | ||
| settings_doc.py | ||
| shots.yml | ||
| spatialite.rst | ||
| sql_queries.rst | ||
| telemetry_doc.py | ||
| template_context.rst | ||
| template_context_doc.py | ||
| testing_plugins.rst | ||
| upgrade-1.0a20.md | ||
| upgrade_guide.md | ||
| writing_plugins.rst | ||