hydromodpy.core.io.db_retry#

Retry decorator for DuckDB writes that may hit a file-level lock.

DuckDB opens the catalog file with a single-writer lock. When a concurrent process is also open on the same file, the second caller raises duckdb.IOException with a message about a conflicting lock. We retry with exponential backoff so short-lived contention (e.g. hmp list running while hmp run commits) resolves transparently.

Only duckdb.IOException is retried. Other exceptions propagate.

Functions

connect_with_retry(db_path, *[, retries, ...])

Open a DuckDB connection, retrying on file-lock contention.

with_lock_retry(*[, retries, backoff, ...])

Retry a method that may raise duckdb.IOException on file lock.