mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Valery Kharseko
yesterday 74fe31b8864568224d9461e712d8e34e8eb8ba97
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/PerformanceRunner.java
@@ -129,14 +129,14 @@
        @Override
        public void run() {
            Promise<?, LdapException> promise;
            Connection connection;
            Connection connectionToUse;
            final double targetTimeMs = 1000.0 / (targetThroughput / (double) (numThreads * numConnections));
            double sleepTimeMs = 0;
            while (!stopRequested && !localStopRequested
                    && (maxIterations <= 0 || count < maxIterations)) {
                try {
                    connection = getConnectionToUse();
                    connectionToUse = getConnectionToUse();
                } catch (final InterruptedException e) {
                    // Ignore and check stop requested
                    continue;
@@ -146,7 +146,7 @@
                }
                long startTimeNs = System.nanoTime();
                promise = performOperation(connection, dataSources.get(), startTimeNs);
                promise = performOperation(connectionToUse, dataSources.get(), startTimeNs);
                statsThread.incrementOperationCount();
                try {
                    promise.getOrThrow();
@@ -161,8 +161,8 @@
                    }
                    // Ignore. Handled by result handler
                } finally {
                    if (this.connection == null) {
                        connection.close();
                    if (connection == null) {
                        connectionToUse.close();
                    }
                }