[ 
https://issues.apache.org/jira/browse/IGNITE-21538?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alexey Scherbakov updated IGNITE-21538:
---------------------------------------
    Summary: Rework component lifecycle mode to asynchronous  (was: Remowk 
component lifycycle mode to asynchronous)

> Rework component lifecycle mode to asynchronous
> -----------------------------------------------
>
>                 Key: IGNITE-21538
>                 URL: https://issues.apache.org/jira/browse/IGNITE-21538
>             Project: Ignite
>          Issue Type: Task
>    Affects Versions: 3.0.0-beta2
>            Reporter: Alexey Scherbakov
>            Priority: Major
>              Labels: ignite-3
>             Fix For: 3.0
>
>
> Current design for comp lifecycle has issues:
> 1. It was designed for synchronous components, but almost all components are 
> asynchronous. 
> This causes to appear ugly things like inBusyLockAsync and inefficient code 
> like
> public @Nullable TxStateMeta stateMeta(UUID txId) \{ return 
> inBusyLock(busyLock, () -> txStateVolatileStorage.state(txId)); }
> 2. Currently it's not possible to do truly graceful node shutdown, because IO 
> layer is disabled out-of-order, causing operation failures.
> I suggest to rework comp lifecycle to async model:
> 1. Each component tracks it's inflight async ops (as list of async chains)
> 2. On start components are initialized using CompletableFuture<Void> 
> startAsync() method from root to leafs of dependency tree
> 3. On shutdown 
> 3.1 CompletableFuture<Void>beforeShutdown is called on comp from leafs to 
> root direction in dependency tree. This step waits for all active futures to 
> complete. Any new operation return a future completed with 
> NodeStoppingException
> 3.2 stop is called on comp from leafs to root direction in dependency tree. 
> This step destroys component resources, like pools, etc.



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

Reply via email to