Skip to content
This repository has been archived by the owner on Feb 1, 2021. It is now read-only.

infinte loop stopping shutdown of server when there is an error #148

Closed
Dolaned opened this issue Apr 9, 2019 · 5 comments
Closed

infinte loop stopping shutdown of server when there is an error #148

Dolaned opened this issue Apr 9, 2019 · 5 comments

Comments

@Dolaned
Copy link
Contributor

Dolaned commented Apr 9, 2019

    if (fReindex)
    {
        CImportingNow imp;
        int nFile = 0;
        while (true) {
            CDiskBlockPos pos(nFile, 0);
            if (!boost::filesystem::exists(GetBlockPosFilename(pos, "blk")))
                break; // No block files left to reindex
            FILE *file = OpenBlockFile(pos, true);
            if (!file)
                break; // This error is logged in OpenBlockFile
            LogPrintf("Reindexing block file blk%05u.dat...\n", (unsigned int)nFile);
            pnetMan->getActivePaymentNetwork()->getChainManager()->LoadExternalBlockFile(chainparams, file, &pos);
            nFile++;
        }
        pnetMan->getActivePaymentNetwork()->getChainManager()->pblocktree->WriteReindexing(false);
        fReindex = false;
        LogPrintf("Reindexing finished\n");
        // To avoid ending up in a situation without genesis block, re-try initializing (no-op if reindexing worked):
        pnetMan->getActivePaymentNetwork()->getChainManager()->InitBlockIndex(chainparams);
    }

i think this bit of codes while(true) completely locks the daemon up and also makes the rpc server unresponsive

@Greg-Griffith
Copy link
Collaborator

please provide a step by step on how to reproduce this issue.

@smogm
Copy link
Contributor

smogm commented May 7, 2019

@gl3nda85 please provide a reproducable scenario.

@Dolaned
Copy link
Contributor Author

Dolaned commented May 10, 2019

just try reindex, its a deadlock

@Dolaned
Copy link
Contributor Author

Dolaned commented May 19, 2019

#188

this covered by 188?

@Greg-Griffith
Copy link
Collaborator

This has been been fixed in #188. closing

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants