You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sap_hana: run schema collection in a DBMAsyncJob background thread (#24128)
* sap_hana: run schema collection in a DBMAsyncJob background thread
Schema collection previously blocked the main check loop on every run.
Wrap HanaSchemaCollector in HanaSchemaCollectionJob (DBMAsyncJob) so it
runs in a background thread at the configured collection_interval, using
its own dedicated hdbcli connection — the same pattern used by the DO job.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* sap_hana: add changelog entry for async schema collection PR #24128
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* sap_hana: address review feedback on schema collection job
- cancel() now stops the schema collection job too, so its background
thread and dedicated HANA connection are released promptly on teardown
instead of lingering until the inactivity timeout.
- Reset the job connection when a HANA error is swallowed inside
collect_schemas(): the base SchemaCollector catches per-database errors
and returns, so a transient disconnect never reached run_job's handler
and the dead connection was reused every cycle. The collector now drops
its connection reference on HanaError and the job reconnects next cycle.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* sap_hana: correct misleading cancel() comment
cancel() only sets each job's cancel event; it does not itself close the
schema job's dedicated HANA connection. Reword the comment to reflect what
cancel() actually does, per DBM review feedback.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* sap_hana: harden schema job connection and version handling
Address review feedback on the async schema collection job:
- Clamp a fractional collection_interval (< 1) so it no longer truncates
to 0 and raises ZeroDivisionError while building rate_limit, which took
down the whole check on construction.
- Replace the overloaded _conn sentinel with an explicit set_connection()
+ connection_lost contract, and drop the dead check._conn fallback so
the catalog query can never silently run on the main check connection.
- Resolve dbms_version on the schema job's dedicated connection via
_resolve_dbms_version(conn) instead of querying the main check
connection off-thread, removing the race and the 'unknown' poisoning.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments