[JAVA-3658] Improve maxCommitTime timeout error message Created: 11/Mar/20 Updated: 18/Mar/20 Resolved: 18/Mar/20 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Error Handling |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Jennifer Huang (Inactive) | Assignee: | Jeffrey Yemin |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
Customer claim, in the Java driver, or probably other drivers, the error message clients get is not clear in the following scenario. 1. When maxCommitTime is set, if a transaction timed out because of writeconcern not met the error message is:
2. When the maxCommitTime is set, but the transaction timed out for commit issues other than writeconcern not met, the error is the same.
Can we make this distinguishable? There're cases where customers wants to retry a transaction in scenario 2, but not 1. |
| Comments |
| Comment by Jennifer Huang (Inactive) [ 18/Mar/20 ] | ||||||||||||||||||||||||||||||||||||
|
nothing wrong with the driver | ||||||||||||||||||||||||||||||||||||
| Comment by Jeffrey Yemin [ 18/Mar/20 ] | ||||||||||||||||||||||||||||||||||||
|
Yes, it sounds right. The server will report an error based on the first timeout that is encountered. | ||||||||||||||||||||||||||||||||||||
| Comment by Jennifer Huang (Inactive) [ 18/Mar/20 ] | ||||||||||||||||||||||||||||||||||||
|
hey jeff.yemin I created the first condition, "When maxCommitTime is set, if a transaction timed out because of writeconcern not met" Got two types of errors depends on whether the maxCommitTime or the writeconcern timeout first. If I set maxCommitTime shorter than wtimeoutMS so commit timeout first I get MongoExecutionTimeoutException error, code 50 and label [UnknownTransactionCommitResult] :
If I set maxCommitTime longer than wtimeoutMS so writeconcern timeout first I got MongoWriteConcernException, code 64 and label: [UnknownTransactionCommitResult]
Didn't create the 2nd condition tho, not sure how to get transaction commit timeout other than writeconcern not met, but it seem whenever maxCommitTime timed out first the MongoExecutionTimeoutException is thrown and according to the code the error code is 50. Customer wants to be able to tell whether the timeout is caused by writeconcern or some other factor, I believe they can distinguish that by alway set maxCommitTime longer than wtimeoutMS and see whether the error is MongoWriteConcernException or MongoExecutionTimeoutException, MongoWriteConcernException = writeconcern timeout failed the commit, MongoExecutionTimeoutException = something else failed the commit. Does that sound right to you? | ||||||||||||||||||||||||||||||||||||
| Comment by Jeffrey Yemin [ 16/Mar/20 ] | ||||||||||||||||||||||||||||||||||||
|
Not sure what you mean by over-written. Can you provide some evidence (e.g. server logs) that the server is returning error code 50 for a write concern error? | ||||||||||||||||||||||||||||||||||||
| Comment by Jeffrey Yemin [ 11/Mar/20 ] | ||||||||||||||||||||||||||||||||||||
|
Looking at the driver source code, it looks like the only error code for which we create this exception type is 50. | ||||||||||||||||||||||||||||||||||||
| Comment by Jeffrey Yemin [ 11/Mar/20 ] | ||||||||||||||||||||||||||||||||||||
|
Hi jennifer.huang, just to make sure we understand exactly what the customer is experiencing, please provide full stack traces for both exceptions. I'm also curious, if they can't distinguish between the two, how they know that the exceptions are for different reasons? |