[CXX-2381] Improve generic server errors returned to the client Created: 05/Oct/21 Updated: 27/Mar/23 Resolved: 20/May/22 |
|
| Status: | Closed |
| Project: | C++ Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Unknown |
| Reporter: | Alex Bevilacqua | Assignee: | Roberto Sanchez |
| Resolution: | Won't Do | Votes: | 2 |
| Labels: | needs-first-responder | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Case: | (copied to CRM) |
| Description |
|
This request is specifically for server-side connection limits being reached and not communicated back to the client application, however other server-side failures could be better reported to clients. For example, after adapting the connection pooling example as follows:
And starting up a mongod with a hard limit of 5 simultaneous connections :
The application will fail with:
The error message is not obviously actionable, though the mongod log in this case contains details that identify the cause of the failure:
|
| Comments |
| Comment by Alex Bevilacqua [ 01/Jun/22 ] |
|
roberto.sanchez@mongodb.com I think your conclusion is acceptable. It makes sense that the server can log the reason for rejecting the connection attempt, and since the connection is never successfully opened that reason can't be communicated "over the wire". |
| Comment by Roberto Sanchez [ 20/May/22 ] |
|
alex.bevilacqua@mongodb.com, it looks like it will not be possible for us to implement the requested improvement. I was able to reproduce the error per your report and with that I was able to determine that this error is being generated in a C driver function which is called by the C++ driver. At that point I was able to investigate what error information might be available at that point in the C driver's interaction with the server that could serve the purpose you requested. Because of the early stage at which this failure is occurring, there is very little in the way of error information available to the driver. I discussed this with the C/C++ driver team members and after a bit of brainstorming we came up empty. Unfortunately, the driver does not have access to the error information from the server log. The connection is attempted and because it is rejected without a connection ever being established there is no way to communicate to that thread the reason for the connection error. To the driver thread it simply appears as though there is some unspecified error. Accepting the connection in order to communicate the server-side error message does not seem like a feasible solution. Additionally, it is not something that can be controlled from the driver side. I am closing this ticket as this is not something which is possible for us to do. If you'd like to suggest alternatives that might be suitable from the driver side, I recommend that you speak with kevin.albertson@mongodb.com. |
| Comment by Alex Bevilacqua [ 05/Oct/21 ] |
|
I'm guessing that the "informational" nature of the error in this case is preventing it from being passed back to the client application/driver. |