Vyacheslav Koptilin created IGNITE-17621:
--------------------------------------------

             Summary: InFlightFutures does not properly register a new future 
which is already in completed state
                 Key: IGNITE-17621
                 URL: https://issues.apache.org/jira/browse/IGNITE-17621
             Project: Ignite
          Issue Type: Bug
            Reporter: Vyacheslav Koptilin
            Assignee: Vyacheslav Koptilin
             Fix For: 3.0.0-alpha6


The following method does not clean up the internal collection of futures in 
case the registered future was completed before calling the _registerFuture_:

{code:java}
    /**
     * Registers a future in the in-flight futures collection. When it 
completes (either normally or exceptionally),
     * it will be removed from the collection.
     *
     * @param future the future to register
     */
    public void registerFuture(CompletableFuture<?> future) {
        future.whenComplete((result, ex) -> inFlightFutures.remove(future));

        inFlightFutures.add(future);
    }
{code}

The fix is quite obvious - we just need to re-order these two lines :)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to