Fixed a rare bug that caused Save OAR to fail because it thought it had timed-out
The bug manifested as follows: a large world was saved. All the assets were found. But for some unknown reason, the timeout timer was restarted. So after 1 minute it closed the Archive Writer, because it didn't receive any more assets during that minute. That caused the OAR to become corrupted because ArchiveWriteRequestExecution.Save() was still running.0.7.4.1
parent
72075e68c7
commit
0588f27d18
|
@ -154,6 +154,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||||
|
|
||||||
protected void OnRequestCallbackTimeout(object source, ElapsedEventArgs args)
|
protected void OnRequestCallbackTimeout(object source, ElapsedEventArgs args)
|
||||||
{
|
{
|
||||||
|
bool close = true;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
lock (this)
|
lock (this)
|
||||||
|
@ -161,7 +163,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||||
// Take care of the possibilty that this thread started but was paused just outside the lock before
|
// Take care of the possibilty that this thread started but was paused just outside the lock before
|
||||||
// the final request came in (assuming that such a thing is possible)
|
// the final request came in (assuming that such a thing is possible)
|
||||||
if (m_requestState == RequestState.Completed)
|
if (m_requestState == RequestState.Completed)
|
||||||
|
{
|
||||||
|
close = false;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
m_requestState = RequestState.Aborted;
|
m_requestState = RequestState.Aborted;
|
||||||
}
|
}
|
||||||
|
@ -208,6 +213,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if (close)
|
||||||
m_assetsArchiver.ForceClose();
|
m_assetsArchiver.ForceClose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -242,11 +248,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||||
|
|
||||||
m_requestCallbackTimer.Stop();
|
m_requestCallbackTimer.Stop();
|
||||||
|
|
||||||
if (m_requestState == RequestState.Aborted)
|
if ((m_requestState == RequestState.Aborted) || (m_requestState == RequestState.Completed))
|
||||||
{
|
{
|
||||||
m_log.WarnFormat(
|
m_log.WarnFormat(
|
||||||
"[ARCHIVER]: Received information about asset {0} after archive save abortion. Ignoring.",
|
"[ARCHIVER]: Received information about asset {0} while in state {1}. Ignoring.",
|
||||||
id);
|
id, m_requestState);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -268,7 +274,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||||
m_notFoundAssetUuids.Add(new UUID(id));
|
m_notFoundAssetUuids.Add(new UUID(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_foundAssetUuids.Count + m_notFoundAssetUuids.Count == m_repliesRequired)
|
if (m_foundAssetUuids.Count + m_notFoundAssetUuids.Count >= m_repliesRequired)
|
||||||
{
|
{
|
||||||
m_requestState = RequestState.Completed;
|
m_requestState = RequestState.Completed;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue