iExecBlockchainComputing/iexec-core

Replicate status concurrent update

mcornaton opened this issue · 0 comments

When a detector detects a missing update and the worker notifies the scheduler at the same time for the same update, both updates will be executed, leading to some incoherent state. Such as:

    Expecting:
     <[CREATED,
        STARTING,
        STARTED,
        APP_DOWNLOADING,
        APP_DOWNLOADED,
        DATA_DOWNLOADING,
        DATA_DOWNLOADED,
        COMPUTING,
        COMPUTED,
        CONTRIBUTING,
        CONTRIBUTED,
        CONTRIBUTED,    <--- CONTRIBUTED x2 ??
        REVEALING,
        REVEALED,
        COMPLETING,
        COMPLETED]>
    to be equal to:
     <[CREATED,
        STARTING,
        STARTED,
        APP_DOWNLOADING,
        APP_DOWNLOADED,
        DATA_DOWNLOADING,
        DATA_DOWNLOADED,
        COMPUTING,
        COMPUTED,
        CONTRIBUTING,
        CONTRIBUTED,
        REVEALING,
        REVEALED,
        COMPLETING,
        COMPLETED]>

This would probably need some synchronization on ReplicatesService#updateReplicateStatus based on worker's wallet address.