[JAVA-3657] Trace logging throws exception logging the connection id when open fails Created: 10/Mar/20  Updated: 28/Oct/23  Resolved: 13/Mar/20

Status: Closed
Project: Java Driver
Component/s: Monitoring
Affects Version/s: None
Fix Version/s: 4.0.1, 3.12.3

Type: Bug Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Ross Lawley
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

When open fails, the driver trace logs a message containing the connectionId.  But DefaultConnectionPool.PooledConnection#getDescription throws if the connection is open. This causes the trace logging statement itself to throw.

We can fix this by allowing calls to DefaultConnectionPool.PooledConnection#getDescription even when the connection is not open.



 Comments   
Comment by Githook User [ 16/Mar/20 ]

Author:

{'username': 'rozza', 'name': 'Ross Lawley', 'email': 'ross.lawley@gmail.com'}

Message: Ensure getting the description doesn't require the pool to be open.

JAVA-3657 JAVA-3616, JAVA-3647
Branch: 3.12.x
https://github.com/mongodb/mongo-java-driver/commit/a7a3a290364bb546a23d177d61910d1107be13ec

Comment by Githook User [ 13/Mar/20 ]

Author:

{'username': 'rozza', 'name': 'Ross Lawley', 'email': 'ross.lawley@gmail.com'}

Message: Ensure getting the description doesn't require the pool to be open.

JAVA-3657 JAVA-3616, JAVA-3647
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/cedb69c82bd4bd321a2929b4110f574dee5a2881

Comment by Githook User [ 13/Mar/20 ]

Author:

{'username': 'rozza', 'name': 'Ross Lawley', 'email': 'ross.lawley@gmail.com'}

Message: Ensure getting the description doesn't require the pool to be open.

JAVA-3657 JAVA-3616, JAVA-3647
Branch: 4.0.x
https://github.com/mongodb/mongo-java-driver/commit/41ca7ca4f42f0a13daaf7095cadcb4c764171cfa

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