Describe the bug
in api_app/services/health_checker.py
container.query_items("SELECT TOP 1 * FROM c")
This does NOT execute the query.
query_items() returns an async iterable (AsyncItemPaged).
No iteration = no request sent to Cosmos DB.
This means the health check can falsely return OK even if Cosmos is down or inaccessible.
Should be:
async for _ in container.query_items("SELECT TOP 1 * FROM c", max_item_count=1): break
Steps to reproduce
- Write a test to check the health and see that it does not match
Azure TRE release version (e.g. v0.14.0 or main):
main
Deployed Azure TRE components - click the (i) in the UI:
latest
Describe the bug
in api_app/services/health_checker.py
container.query_items("SELECT TOP 1 * FROM c")This does NOT execute the query.
query_items() returns an async iterable (AsyncItemPaged).
No iteration = no request sent to Cosmos DB.
This means the health check can falsely return OK even if Cosmos is down or inaccessible.
Should be:
async for _ in container.query_items("SELECT TOP 1 * FROM c", max_item_count=1): breakSteps to reproduce
Azure TRE release version (e.g. v0.14.0 or main):
main
Deployed Azure TRE components - click the (i) in the UI:
latest