protected void runChecks()

in src/main/java/org/apache/commons/pool3/impl/ResilientPooledObjectFactory.java [450:482]


    protected void runChecks() {
        boolean upOverLog = true;
        // 1. If the log is full, remove the oldest (first) event.
        //
        // 2. Walk the event log. If we find a failure, set downStart, set up to false
        // and start the adder thread.
        //
        // 3. If the log contains only successes, if up is false, set upStart and up to
        // true
        // and kill the adder thread.
        while (makeObjectLog.size() > logSize) {
            makeObjectLog.poll();
        }
        for (final MakeEvent makeEvent : makeObjectLog) {
            if (!makeEvent.isSuccess()) {
                upOverLog = false;
                downStart = Instant.now();
                up = false;
                if (pool.getNumWaiters() > 0 && !pool.isClosed() && adder == null) {
                    adder = new Adder();
                    adder.start();
                }
            }

        }
        if (upOverLog && !up) {
            // Kill adder thread and set up to true
            upStart = Instant.now();
            up = true;
            adder.kill();
            adder = null;
        }
    }