"http-nio-11022-exec-196"#216701 daemon prio=5 os_prio=0 tid=0x00007fbac4082000 nid=0x3c4a waiting on condition [0x00007fba0fb52000] java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to waitfor <0x00007fbb318710f0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039) at com.alibaba.druid.pool.DruidDataSource.takeLast(DruidDataSource.java:1899) at com.alibaba.druid.pool.DruidDataSource.getConnectionInternal(DruidDataSource.java:1460) at com.alibaba.druid.pool.DruidDataSource.getConnectionDirect(DruidDataSource.java:1255) at com.alibaba.druid.filter.FilterChainImpl.dataSource_connect(FilterChainImpl.java:5007) at com.alibaba.druid.filter.FilterAdapter.dataSource_getConnection(FilterAdapter.java:2745) at com.alibaba.druid.filter.FilterChainImpl.dataSource_connect(FilterChainImpl.java:5003) at com.alibaba.druid.filter.logging.LogFilter.dataSource_getConnection(LogFilter.java:876) at com.alibaba.druid.filter.FilterChainImpl.dataSource_connect(FilterChainImpl.java:5003) at com.alibaba.druid.filter.stat.StatFilter.dataSource_getConnection(StatFilter.java:680) at com.alibaba.druid.filter.FilterChainImpl.dataSource_connect(FilterChainImpl.java:5003) at com.alibaba.druid.filter.FilterAdapter.dataSource_getConnection(FilterAdapter.java:2745) at com.alibaba.druid.filter.FilterChainImpl.dataSource_connect(FilterChainImpl.java:5003) at com.alibaba.druid.filter.stat.StatFilter.dataSource_getConnection(StatFilter.java:680) at com.alibaba.druid.filter.FilterChainImpl.dataSource_connect(FilterChainImpl.java:5003) at com.alibaba.druid.filter.FilterAdapter.dataSource_getConnection(FilterAdapter.java:2745) at com.alibaba.druid.filter.FilterChainImpl.dataSource_connect(FilterChainImpl.java:5003) at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1233) at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1225) at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:90) at com.atour.db.DynamicDataSource.getConnection(DynamicDataSource.java:140) at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:151) at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115) at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78) at org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:82) at org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:68) at com.atour.migrate.helper.mybatis.interceptor.MyBatisMigrateChainIdKiller.checkDsIgnoreTableStatus(MyBatisMigrateChainIdKiller.java:181)
decrementPoolingCount(); DruidConnectionHolder last = connections[poolingCount]; connections[poolingCount] = null;
return last; }
等待在druid的notEmpty队里上,等待有可用的连接。找到对应的创建连接线程:
1 2 3 4 5 6 7 8 9 10
"Druid-ConnectionPool-Create-219971169"#80 daemon prio=5 os_prio=0 tid=0x00007fbab2fce000 nid=0x67e0 waiting on condition [0x00007fba2b974000] java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to waitfor <0x00007fbb31048098> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039) at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2448)
org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: SQL Server 未返回响应。连接已关闭。 at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:81) at org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:82) at org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:68) at com.atour.migrate.helper.mybatis.interceptor.MyBatisMigrateChainIdKiller.checkDsIgnoreTableStatus(MyBatisMigrateChainIdKiller.java:181) ... Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: SQL Server 未返回响应。连接已关闭。 at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1667) at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1654) at com.microsoft.sqlserver.jdbc.TDSReader.readPacket(IOBuffer.java:4844) at com.microsoft.sqlserver.jdbc.TDSCommand.startResponse(IOBuffer.java:6154) at com.microsoft.sqlserver.jdbc.TDSCommand.startResponse(IOBuffer.java:6106) at com.microsoft.sqlserver.jdbc.SQLServerConnection$1ConnectionCommand.doExecute(SQLServerConnection.java:1756) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696) at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectionCommand(SQLServerConnection.java:1761) at com.microsoft.sqlserver.jdbc.SQLServerConnection.setCatalog(SQLServerConnection.java:2063) at com.alibaba.druid.filter.FilterChainImpl.connection_setCatalog(FilterChainImpl.java:750) at com.alibaba.druid.filter.FilterAdapter.connection_setCatalog(FilterAdapter.java:991) at com.alibaba.druid.filter.FilterChainImpl.connection_setCatalog(FilterChainImpl.java:745) at com.alibaba.druid.filter.FilterAdapter.connection_setCatalog(FilterAdapter.java:991) at com.alibaba.druid.filter.FilterChainImpl.connection_setCatalog(FilterChainImpl.java:745) at com.alibaba.druid.filter.FilterAdapter.connection_setCatalog(FilterAdapter.java:991) at com.alibaba.druid.filter.FilterChainImpl.connection_setCatalog(FilterChainImpl.java:745) at com.alibaba.druid.filter.FilterAdapter.connection_setCatalog(FilterAdapter.java:991) at com.alibaba.druid.filter.FilterChainImpl.connection_setCatalog(FilterChainImpl.java:745) at com.alibaba.druid.filter.FilterAdapter.connection_setCatalog(FilterAdapter.java:991) at com.alibaba.druid.filter.FilterChainImpl.connection_setCatalog(FilterChainImpl.java:745) at com.alibaba.druid.filter.FilterAdapter.connection_setCatalog(FilterAdapter.java:991) at com.alibaba.druid.filter.FilterChainImpl.connection_setCatalog(FilterChainImpl.java:745) at com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl.setCatalog(ConnectionProxyImpl.java:437) at com.alibaba.druid.pool.DruidPooledConnection.setCatalog(DruidPooledConnection.java:910) at com.atour.db.DynamicDataSource.getConnection(DynamicDataSource.java:143) at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:151) at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115) at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78) ... 131 common frames omitted
com.microsoft.sqlserver.jdbc.SQLServerException: 通过端口 1433 连接到主机 R8IC10364 的 TCP/IP 连接失败。错误:“null。请验证连接属性。确保 SQL Server 的实例正在主机上运行,且在此端口接受 TCP/IP 连接,还要确保防火墙没有阻止到此端口的 TCP 连接。”。 at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:190) at com.microsoft.sqlserver.jdbc.SQLServerException.ConvertConnectExceptionToSQLServerException(SQLServerException.java:241) at com.microsoft.sqlserver.jdbc.SocketFinder.findSocket(IOBuffer.java:2243) at com.microsoft.sqlserver.jdbc.TDSChannel.open(IOBuffer.java:491) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1309)
org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: Database 'xxx' cannot be opened. It is in the middle of a restore. at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:81) at org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:82) ... Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Database 'xxxx' cannot be opened. It is in the middle of a restore. at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:216) at com.microsoft.sqlserver.jdbc.TDSTokenHandler.onEOF(tdsparser.java:254) at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:84) at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:39) at com.microsoft.sqlserver.jdbc.SQLServerConnection$1ConnectionCommand.doExecute(SQLServerConnection.java:1756) at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:5696) at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1715) at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectionCommand(SQLServerConnection.java:1761) at com.microsoft.sqlserver.jdbc.SQLServerConnection.setCatalog(SQLServerConnection.java:2063) at com.alibaba.druid.filter.FilterChainImpl.connection_setCatalog(FilterChainImpl.java:750) at com.alibaba.druid.filter.FilterAdapter.connection_setCatalog(FilterAdapter.java:991) at com.alibaba.druid.filter.FilterChainImpl.connection_setCatalog(FilterChainImpl.java:745) at com.alibaba.druid.filter.FilterAdapter.connection_setCatalog(FilterAdapter.java:991) at com.alibaba.druid.filter.FilterChainImpl.connection_setCatalog(FilterChainImpl.java:745) at com.alibaba.druid.filter.FilterAdapter.connection_setCatalog(FilterAdapter.java:991) at com.alibaba.druid.filter.FilterChainImpl.connection_setCatalog(FilterChainImpl.java:745) at com.alibaba.druid.filter.FilterAdapter.connection_setCatalog(FilterAdapter.java:991) at com.alibaba.druid.filter.FilterChainImpl.connection_setCatalog(FilterChainImpl.java:745) at com.alibaba.druid.filter.FilterAdapter.connection_setCatalog(FilterAdapter.java:991) at com.alibaba.druid.filter.FilterChainImpl.connection_setCatalog(FilterChainImpl.java:745) at com.alibaba.druid.filter.FilterAdapter.connection_setCatalog(FilterAdapter.java:991) at com.alibaba.druid.filter.FilterChainImpl.connection_setCatalog(FilterChainImpl.java:745) at com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl.setCatalog(ConnectionProxyImpl.java:437) at com.alibaba.druid.pool.DruidPooledConnection.setCatalog(DruidPooledConnection.java:910) at com.atour.db.DynamicDataSource.getConnection(DynamicDataSource.java:143) at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:151) at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115) at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78) ... 131 common frames omitted