mirror of
https://bitbucket.org/theswgsource/src-1.2.git
synced 2026-08-03 04:19:20 -04:00
prevent death of server if we're waiting on a save to finish but still warn about it; only lock at the top of saveCompleted
This commit is contained in:
@@ -261,8 +261,7 @@ void Persister::onFrameBarrierReached()
|
||||
}
|
||||
|
||||
// Check for whether it is time to save
|
||||
|
||||
FATAL(m_timeSinceLastSave > ConfigServerDatabase::getMaxTimewarp(),("Save was not completed within %i seconds. Shutting down to avoid a longer timewarp.\n",ConfigServerDatabase::getMaxTimewarp()));
|
||||
WARNING(m_timeSinceLastSave > ConfigServerDatabase::getMaxTimewarp(),("Save was not completed within %i seconds. We may experience a \"time warp\"\n",ConfigServerDatabase::getMaxTimewarp()));
|
||||
|
||||
if (ConfigServerDatabase::getSaveAtModulus()!=-1)
|
||||
{
|
||||
@@ -617,22 +616,17 @@ void Persister::endBaselines(const NetworkId &objectId, uint32 serverId)
|
||||
|
||||
void Persister::saveCompleted(Snapshot *completedSnapshot)
|
||||
{
|
||||
{
|
||||
std::lock_guard<std::mutex> lck(m_savingDeleting_mtx);
|
||||
std::lock_guard<std::mutex> lck(m_savingDeleting_mtx);
|
||||
|
||||
delete completedSnapshot;
|
||||
completedSnapshot = nullptr;
|
||||
}
|
||||
auto i=std::remove(m_savingSnapshots.begin(),m_savingSnapshots.end(),completedSnapshot);
|
||||
delete completedSnapshot;
|
||||
completedSnapshot = nullptr;
|
||||
|
||||
auto i=std::remove(m_savingSnapshots.begin(),m_savingSnapshots.end(),completedSnapshot);
|
||||
|
||||
if (i!=m_savingSnapshots.end())
|
||||
{
|
||||
|
||||
{
|
||||
std::lock_guard<std::mutex> lck(m_savingDeleting_mtx);
|
||||
WARNING(true, ("m_SavingSnapshots is not empty and we're nuking everything for some reason. Is this a leak?"));
|
||||
m_savingSnapshots.erase(i, m_savingSnapshots.end());
|
||||
}
|
||||
WARNING(true, ("m_SavingSnapshots is not empty and we're nuking everything for some reason. Is this a leak?"));
|
||||
m_savingSnapshots.erase(i, m_savingSnapshots.end());
|
||||
|
||||
if (m_savingSnapshots.empty() && ConfigServerDatabase::getReportSaveTimes())
|
||||
{
|
||||
@@ -663,11 +657,9 @@ void Persister::saveCompleted(Snapshot *completedSnapshot)
|
||||
}
|
||||
else
|
||||
{
|
||||
std::lock_guard<std::mutex> lck(m_savingDeleting_mtx);
|
||||
|
||||
auto j=std::remove(m_savingCharacterSnapshots.begin(),m_savingCharacterSnapshots.end(),completedSnapshot);
|
||||
|
||||
WARNING(j==m_savingCharacterSnapshots.end(),("saveCompleted() called w/o snap in m_savingSnapshots or m_savingCharacterSnapshots."));
|
||||
DEBUG_WARNING(j==m_savingCharacterSnapshots.end(),("saveCompleted() called w/o snap in m_savingSnapshots or m_savingCharacterSnapshots."));
|
||||
|
||||
m_savingCharacterSnapshots.erase(j, m_savingCharacterSnapshots.end());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user