As of #11466 we no longer have any logic to prevent a user from opening a wallet twice in two instances simultaneously. Not only could this break BDB (without the -privdb=false option, which I have really no idea why we even have a tuneable option for that), but we certainly don't have logic to handle such a case gracefully. It was noted in the original PR's description, but somehow was never followed up on before merge.
{
    fs::ifstream streamConfig(GetConfigFile(confPath));
    if (!streamConfig.good())
        return; 
    {
        LOCK(cs_args);
        std::set<std::string> setOptions;
        setOptions.insert("*");
        for (boost::program_options::detail::config_file_iterator it(streamConfig, setOptions), end; it != end; ++it)
        {
            
            std::string strKey = std::string("-") + it->string_key;
            std::string strValue = it->value[0];
            InterpretNegativeSetting(strKey, strValue);
            if (mapArgs.count(strKey) == 0)
                mapArgs[strKey] = strValue;
            mapMultiArgs[strKey].push_back(strValue);
        }
    }
    
    ClearDatadirCache();
    if (!fs::is_directory(GetDataDir(false))) {
        throw std::runtime_error(strprintf("specified data directory \"%s\" does not exist.", gArgs.GetArg("-datadir", "").c_str()));
    }
}
#ifndef WIN32
fs::path GetPidFile()