Azure / azure-sdk-for-java

This repository is for active development of the Azure SDK for Java. For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/java/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-java.
MIT License
2.35k stars 1.99k forks source link

[BUG] Cosmos DB findByItem logs the following constantly when no item is found: "WebExceptionRetryPolicy() No Retrying on un-retryable exceptions on endpoint xxx" #37912

Closed simplyanything closed 11 months ago

simplyanything commented 11 months ago

Describe the bug Using Cosmos DB Spring Data, each read operation (using findbyId) which couldn't find the item in the database logs a WebExceptionRetryPolicy() No Retrying on un-retryable exceptions on endpoint xxx, operationType = Read, resourceType = Document, count = 0, isAddressRefresh = false. This didn't happen before, and it's cluttering the logs. The read operation still went successful (as in, it couldn't find the item). We've upgraded our Spring Boot version from 3.1.3 to 3.1.6, and have upgraded our spring-cloud-azure version with spring-cloud-azure-starter-data-cosmos from 5.5.0 to 5.7.0. Each read operation is triggering the following log (real endpoint is replaced with xxx):

Exception or Stack Trace WebExceptionRetryPolicy() No Retrying on un-retryable exceptions on endpoint xxx, operationType = Read, resourceType = Document, count = 0, isAddressRefresh = false

To Reproduce Steps to reproduce the behavior: (see code snippet)

Code Snippet userRepository.findbyId(id, new PartitionKey(id)).get()

(The above operation should return a 404 — item not found in database)

UserRepository:

@Repository
public interface UserRepository extends CosmosRepository<User, String> {
}

Expected behavior Why is this log shown for each read operation? The previous version we have used didn't log this for each read operation (where the item couldn't be found).

Setup (please complete the following information):

Additional context My only hunch is that Spring boot 3.1.x is not officially supported yet by spring cloud-azure-starter-data-cosmos. Can this log be omitted at all? Do we have to implement some retry?

Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

kushagraThapar commented 11 months ago

@xinlian12 does your PR addresses this issue? https://github.com/Azure/azure-sdk-for-java/pull/37918 If so, can you please close this issue, thanks!

FabianMeiswinkel commented 11 months ago

Yes it does.

FabianMeiswinkel commented 11 months ago

Fixed by PR #37918