xiamenmin commented on issue #21964:
URL: 
https://github.com/apache/shardingsphere/issues/21964#issuecomment-1477567901

   This problem still exists. First of all, I see that the code is only added 
in the 5.1.0 + version
   - 
https://github.com/apache/shardingsphere/blob/master/docs/blog/content/material/2022_03_18_Executor_Engine_Performance_Optimization_Showcase_with_Apache_ShardingSphere_5.1.0.en.md
   
   But if `isNeedAggregateRewrite` is not hit, there will still be a deadlock 
problem, because there is no lock in the source code to obtain the connection 
pool.
   
   `public final class ConnectionManager implements 
ExecutorJDBCConnectionManager, AutoCloseable {
       private List<Connection> createConnections(final String dataSourceName, 
final DataSource dataSource, final int connectionSize,
                                                  final 
TransactionConnectionContext transactionConnectionContext) throws SQLException {
           List<Connection> result = new ArrayList<>(connectionSize);
           for (int i = 0; i < connectionSize; i++) {
               try {
                   Connection connection = createConnection(dataSourceName, 
dataSource, transactionConnectionContext);
                   methodInvocationRecorder.replay(connection);
                   result.add(connection);
               } catch (final SQLException ex) {
                   for (Connection each : result) {
                       each.close();
                   }
                   throw new 
OverallConnectionNotEnoughException(connectionSize, 
result.size()).toSQLException();
               }
           }
           return result;
       }
   }`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to