[JAVA-4910] Retry debug log message is logged twice Created: 17/Mar/23  Updated: 28/Oct/23  Resolved: 24/Apr/23

Status: Closed
Project: Java Driver
Component/s: Logging
Affects Version/s: None
Fix Version/s: 4.10.0

Type: Bug Priority: Minor - P4
Reporter: Jeffrey Yemin Assignee: Valentin Kavalenka
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
Backwards Compatibility: Fully Compatible
Documentation Changes: Needed
Documentation Changes Summary:

We may mention in What's new that we no longer duplicate log messages about retries.


 Description   

Running any of the retryable reads tests with operation debug logging enabled yields output like this:

23:01:28.857 [Test worker] DEBUG org.mongodb.driver.operation - Retrying the operation aggregate due to the error "com.mongodb.MongoNotPrimaryException: Command failed with error 10107 (NotWritablePrimary): 'Failing command via 'failCommand' failpoint' on server localhost:27017. The full response is {"ok": 0.0, "errmsg": "Failing command via 'failCommand' failpoint", "code": 10107, "codeName": "NotWritablePrimary"}"; attempt #2
23:01:28.857 [Test worker] DEBUG org.mongodb.driver.operation - Retrying the operation aggregate due to the error "com.mongodb.MongoNotPrimaryException: Command failed with error 10107 (NotWritablePrimary): 'Failing command via 'failCommand' failpoint' on server localhost:27017. The full response is {"ok": 0.0, "errmsg": "Failing command via 'failCommand' failpoint", "code": 10107, "codeName": "NotWritablePrimary"}"; attempt #2

It should only be logged once. Not sure if the same is true for retryable writes, but it likely is.



 Comments   
Comment by Githook User [ 24/Apr/23 ]

Author:

{'name': 'Valentin Kovalenko', 'email': 'valentin.kovalenko@mongodb.com', 'username': 'stIncMale'}

Message: Fix duplicate retry log messages (#1108)

JAVA-4910
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/8f6ace41d0d86e8402cc955754f159b9b62326aa

Generated at Thu Feb 08 09:03:16 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.