When using ConnMaxIdleTime, when a pool connection is expired and then it fails to close, the error is suppressed here (if I understand correctly). I expect the error to be suppressed in the same manner when calling pool.Close(), but instead the error is returned. This makes it seem like something has gone wrong in a normal state where the server is expected to silently close idle connections (e.g. ElasticCache).
Expected Behavior
The Pool Close() method returns nil when connections fail to close where ConnMaxIdleTime is exceeded.
Current Behavior
Close() returns an error: tls: failed to send closeNotify alert (but connection was closed anyway): write tcp [redacted]: write: connection timed out
Possible Solution
If isHealthyConn is true, drop the error, similar to here.
Steps to Reproduce
- Connect to a server that drops idle connections after a timeout
- Configure a pool with
ConnMaxIdleTime less than the server idle timeout
- Use the pool
- Wait for a connection to expire from the server
- Call
pool.Close()
Context (Environment)
Detailed Description
Possible Implementation
When using
ConnMaxIdleTime, when a pool connection is expired and then it fails to close, the error is suppressed here (if I understand correctly). I expect the error to be suppressed in the same manner when callingpool.Close(), but instead the error is returned. This makes it seem like something has gone wrong in a normal state where the server is expected to silently close idle connections (e.g. ElasticCache).Expected Behavior
The Pool
Close()method returnsnilwhen connections fail to close whereConnMaxIdleTimeis exceeded.Current Behavior
Close()returns an error:tls: failed to send closeNotify alert (but connection was closed anyway): write tcp [redacted]: write: connection timed outPossible Solution
If
isHealthyConnis true, drop the error, similar to here.Steps to Reproduce
ConnMaxIdleTimeless than the server idle timeoutpool.Close()Context (Environment)
Detailed Description
Possible Implementation