问题
As part of error handling for our processes, we have tried to disable the communication between the process to the database machine listener port using the following iptables command
iptables -A INPUT -p tcp --destination-port <database-listener-port> -s <database-host-ip> -j DROP
However, this cause the process to get stuck with the following log coming from AbstractPlatformTransactionManager::getTransaction
DEBUG: Creating new transaction with name [<Transaction-Name>]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT; ''
Enabling it, later on with 'iptables -F' makes the transaction 'get back to life' again and the connection is being retrieved and ends successfully.
We are most concern with the fact all connection timeout configuration were not activated (?) and therefore we so such hangs, none of our connection pool defaults (see below) has such infinite timeout (we tried also giving a small default for the abandonedConnectionTimeout but it didn't help and we returned for the true default we believe should be in production) and we expected some kind of cancel operation should be performed.
abandonedConnectionTimeout=0
acquireIncrement=5
acquireRetryAttempts=3
checkoutTimeout=5000
idleConnectionTestPeriod=60
inactivityTimeout=1800
inactivityTimeoutforNonUsedConnection=1800
validateConnection=true
Thanks for any assist on this matter.
来源:https://stackoverflow.com/questions/26417384/spring-transaction-hangs-for-iptables-command