spring-projects/spring-integration — pull request #911 by garyrussell (2013-10-05 18:12:36+00:00)
Title: INT-3163 Force Connection Close on Send Exception

Previously, when an exception occurred on a send, the
connection was not forcibly closed. When using a
CachingClientConnectionFactory, this prevented the connection
(albeit stale) from being returned to the cache.

Perform a forced (physical) close whenever a send fails.

Add test cases for both Net and NIO implementations, using
a CCCF, to verify the connection is returned to the pool so
the closed state can be detected on the next retrieval, causing
a refresh.

Also, change the synchronization in the NIO send to
synchronize on the connection, not the mapper (which is
shared).