Problem
close_client() stops the Alternator live-node manager and clears internal references, but it does not close the underlying botocore HTTP session. Boto3 clients expose a .close() method for this, and boto3 resources expose it through resource.meta.client.close().
Async cleanup already closes the underlying aiobotocore client in close_async_client(), so sync and async lifecycle behavior diverges.
Evidence
Relevant code:
alternator/client.py: close_client() stops the manager and clears the partition-key cache reference, then returns.
alternator/async_client.py: close_async_client() always calls await client.__aexit__(...) in a finally block.
A local check confirmed boto3 DynamoDB clients have .close(), while resources have .meta.client.close().
Expected behavior
close_client() / close_resource() should close the underlying botocore client transport after Alternator-specific cleanup.
Test coverage needed
Add sync lifecycle tests that use mocks or real boto3 clients to verify:
close_client(client) calls client.close().
close_client(resource) calls resource.meta.client.close().
- cleanup remains idempotent.
Problem
close_client()stops the Alternator live-node manager and clears internal references, but it does not close the underlying botocore HTTP session. Boto3 clients expose a.close()method for this, and boto3 resources expose it throughresource.meta.client.close().Async cleanup already closes the underlying aiobotocore client in
close_async_client(), so sync and async lifecycle behavior diverges.Evidence
Relevant code:
alternator/client.py:close_client()stops the manager and clears the partition-key cache reference, then returns.alternator/async_client.py:close_async_client()always callsawait client.__aexit__(...)in afinallyblock.A local check confirmed boto3 DynamoDB clients have
.close(), while resources have.meta.client.close().Expected behavior
close_client()/close_resource()should close the underlying botocore client transport after Alternator-specific cleanup.Test coverage needed
Add sync lifecycle tests that use mocks or real boto3 clients to verify:
close_client(client)callsclient.close().close_client(resource)callsresource.meta.client.close().