[DRIVERS-273] Local socket information for exceptions Created: 22/Oct/15  Updated: 20/Apr/20  Resolved: 20/Apr/20

Status: Closed
Project: Drivers
Component/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Andrew Ryder (Inactive) Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on DRIVERS-2106 Include local ephemeral port in APM c... Backlog
Related

 Description   

At this time when an exception is thrown by a driver, be it network related or a server command, very few (if any) drivers provide direct information about the socket involved in the communication attempt. This can be important information to correlate a server event (presuming that server information is known) with a client side event.

It would greatly assist debugging efforts if exceptions raised by drivers, where a socket is known, to provide in the exception object the local IP and ephemeral port the socket was bound to (language permitting).



 Comments   
Comment by Bernie Hackett [ 01/Nov/16 ]

Actually, getsockname should do the trick.

Comment by Bernie Hackett [ 01/Nov/16 ]

jblackburn, how important is local ip address? That's actually surprisingly difficult to figure out.

Comment by James Blackburn [ 02/Dec/15 ]

Oh, that's cool anyhow - I'm interested in both. So will look into that too.

Comment by Bernie Hackett [ 12/Nov/15 ]

Oh, never mind, I see that this request is for local ephemeral port information, not the server endpoint.

Comment by Bernie Hackett [ 12/Nov/15 ]

This problem is solved by the command monitoring spec. Assuming the application registers an event listener, all published events (started, succeeded, failed) include the connection id:

https://github.com/mongodb/specifications/blob/master/source/command-monitoring/command-monitoring.rst#api

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