Skip to content

fix max_db_size#24

Open
aheev wants to merge 2 commits into
LadybugDB:mainfrom
aheev:fix-max-db-size
Open

fix max_db_size#24
aheev wants to merge 2 commits into
LadybugDB:mainfrom
aheev:fix-max-db-size

Conversation

@aheev
Copy link
Copy Markdown
Contributor

@aheev aheev commented May 30, 2026

fixes #22

@aheev aheev force-pushed the fix-max-db-size branch from 92de9a6 to d06f594 Compare May 30, 2026 10:28
Comment thread test/conftest.py
_POOL_SIZE_: int = 256 * 1024 * 1024
# Use 1GB max DB size for tests to avoid exhausting virtual address space
# when many databases are open simultaneously (CI runners may have tight VA limits)
_MAX_DB_SIZE_: int = 1 << 30
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also:

# Wrap it inside a fixture
@pytest.fixture(scope="session")
def max_db_size():
    return _MAX_DB_SIZE

Comment thread test/test_wal.py

import ladybug as lb
db = lb.Database(r"{db_path!s}")
db = lb.Database(r"{db_path!s}", max_db_size=1 << 30)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and the few instances below, use the max_db_size from the fixture.

Comment thread src_py/_lbug_capi.py
compression: bool = True,
read_only: bool = False,
max_db_size: int = (1 << 30),
max_db_size: int = 0xFFFFFFFF,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the backend default instead of replicating the defaults here. Something like:

https://gist.github.com/adsharma/d9f1bad5f9921a3ea57c88d8fe085cd7

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.

Database defaults max_db_size to 1 GiB on all platforms, contradicting its docstring (8 TiB on 64-bit)

2 participants