aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorOren Hurvitz2012-07-16 10:30:38 +0300
committerJustin Clark-Casey (justincc)2012-08-03 01:12:46 +0100
commit0588f27d1886970e44765166714f24114d399fce (patch)
tree8c3845815dce535cdca25616bc0a7502935f119d /OpenSim
parentSave membership fee to the database when a group is created. (diff)
downloadopensim-SC-0588f27d1886970e44765166714f24114d399fce.zip
opensim-SC-0588f27d1886970e44765166714f24114d399fce.tar.gz
opensim-SC-0588f27d1886970e44765166714f24114d399fce.tar.bz2
opensim-SC-0588f27d1886970e44765166714f24114d399fce.tar.xz
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.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs16
1 files changed, 11 insertions, 5 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs
index 55110dc..a073cb9 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs
@@ -154,6 +154,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
154 154
155 protected void OnRequestCallbackTimeout(object source, ElapsedEventArgs args) 155 protected void OnRequestCallbackTimeout(object source, ElapsedEventArgs args)
156 { 156 {
157 bool close = true;
158
157 try 159 try
158 { 160 {
159 lock (this) 161 lock (this)
@@ -161,7 +163,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver
161 // Take care of the possibilty that this thread started but was paused just outside the lock before 163 // Take care of the possibilty that this thread started but was paused just outside the lock before
162 // the final request came in (assuming that such a thing is possible) 164 // the final request came in (assuming that such a thing is possible)
163 if (m_requestState == RequestState.Completed) 165 if (m_requestState == RequestState.Completed)
166 {
167 close = false;
164 return; 168 return;
169 }
165 170
166 m_requestState = RequestState.Aborted; 171 m_requestState = RequestState.Aborted;
167 } 172 }
@@ -208,7 +213,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
208 } 213 }
209 finally 214 finally
210 { 215 {
211 m_assetsArchiver.ForceClose(); 216 if (close)
217 m_assetsArchiver.ForceClose();
212 } 218 }
213 } 219 }
214 220
@@ -242,11 +248,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver
242 248
243 m_requestCallbackTimer.Stop(); 249 m_requestCallbackTimer.Stop();
244 250
245 if (m_requestState == RequestState.Aborted) 251 if ((m_requestState == RequestState.Aborted) || (m_requestState == RequestState.Completed))
246 { 252 {
247 m_log.WarnFormat( 253 m_log.WarnFormat(
248 "[ARCHIVER]: Received information about asset {0} after archive save abortion. Ignoring.", 254 "[ARCHIVER]: Received information about asset {0} while in state {1}. Ignoring.",
249 id); 255 id, m_requestState);
250 256
251 return; 257 return;
252 } 258 }
@@ -268,7 +274,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
268 m_notFoundAssetUuids.Add(new UUID(id)); 274 m_notFoundAssetUuids.Add(new UUID(id));
269 } 275 }
270 276
271 if (m_foundAssetUuids.Count + m_notFoundAssetUuids.Count == m_repliesRequired) 277 if (m_foundAssetUuids.Count + m_notFoundAssetUuids.Count >= m_repliesRequired)
272 { 278 {
273 m_requestState = RequestState.Completed; 279 m_requestState = RequestState.Completed;
274 280