diff options
author | Oren Hurvitz | 2012-08-23 21:23:16 +0300 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-01-02 22:15:00 +0000 |
commit | d2f4ca0dfed69637892c2346fa87c88f08c9b8e5 (patch) | |
tree | 30a4953d17c70e61d5e35e62d2f5c6f8a310d0a4 /OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs | |
parent | minor: Allow objects to be added directly to a row on a ConsoleDisplayTable r... (diff) | |
download | opensim-SC_OLD-d2f4ca0dfed69637892c2346fa87c88f08c9b8e5.zip opensim-SC_OLD-d2f4ca0dfed69637892c2346fa87c88f08c9b8e5.tar.gz opensim-SC_OLD-d2f4ca0dfed69637892c2346fa87c88f08c9b8e5.tar.bz2 opensim-SC_OLD-d2f4ca0dfed69637892c2346fa87c88f08c9b8e5.tar.xz |
If Save OAR/IAR times-out while waiting for assets then notify the caller that the operation failed
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs index 103eb47..b22bcf9 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs | |||
@@ -50,7 +50,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
50 | /// Method called when all the necessary assets for an archive request have been received. | 50 | /// Method called when all the necessary assets for an archive request have been received. |
51 | /// </summary> | 51 | /// </summary> |
52 | public delegate void AssetsRequestCallback( | 52 | public delegate void AssetsRequestCallback( |
53 | ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids); | 53 | ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids, bool timedOut); |
54 | 54 | ||
55 | enum RequestState | 55 | enum RequestState |
56 | { | 56 | { |
@@ -148,7 +148,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
148 | if (m_repliesRequired == 0) | 148 | if (m_repliesRequired == 0) |
149 | { | 149 | { |
150 | m_requestState = RequestState.Completed; | 150 | m_requestState = RequestState.Completed; |
151 | PerformAssetsRequestCallback(null); | 151 | PerformAssetsRequestCallback(false); |
152 | return; | 152 | return; |
153 | } | 153 | } |
154 | 154 | ||
@@ -164,7 +164,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
164 | 164 | ||
165 | protected void OnRequestCallbackTimeout(object source, ElapsedEventArgs args) | 165 | protected void OnRequestCallbackTimeout(object source, ElapsedEventArgs args) |
166 | { | 166 | { |
167 | bool close = true; | 167 | bool timedOut = true; |
168 | 168 | ||
169 | try | 169 | try |
170 | { | 170 | { |
@@ -174,7 +174,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
174 | // the final request came in (assuming that such a thing is possible) | 174 | // the final request came in (assuming that such a thing is possible) |
175 | if (m_requestState == RequestState.Completed) | 175 | if (m_requestState == RequestState.Completed) |
176 | { | 176 | { |
177 | close = false; | 177 | timedOut = false; |
178 | return; | 178 | return; |
179 | } | 179 | } |
180 | 180 | ||
@@ -223,8 +223,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
223 | } | 223 | } |
224 | finally | 224 | finally |
225 | { | 225 | { |
226 | if (close) | 226 | if (timedOut) |
227 | m_assetsArchiver.ForceClose(); | 227 | Util.FireAndForget(PerformAssetsRequestCallback, true); |
228 | } | 228 | } |
229 | } | 229 | } |
230 | 230 | ||
@@ -294,7 +294,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
294 | 294 | ||
295 | // We want to stop using the asset cache thread asap | 295 | // We want to stop using the asset cache thread asap |
296 | // as we now need to do the work of producing the rest of the archive | 296 | // as we now need to do the work of producing the rest of the archive |
297 | Util.FireAndForget(PerformAssetsRequestCallback); | 297 | Util.FireAndForget(PerformAssetsRequestCallback, false); |
298 | } | 298 | } |
299 | else | 299 | else |
300 | { | 300 | { |
@@ -315,9 +315,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
315 | { | 315 | { |
316 | Culture.SetCurrentCulture(); | 316 | Culture.SetCurrentCulture(); |
317 | 317 | ||
318 | Boolean timedOut = (Boolean)o; | ||
319 | |||
318 | try | 320 | try |
319 | { | 321 | { |
320 | m_assetsRequestCallback(m_foundAssetUuids, m_notFoundAssetUuids); | 322 | m_assetsRequestCallback(m_foundAssetUuids, m_notFoundAssetUuids, timedOut); |
321 | } | 323 | } |
322 | catch (Exception e) | 324 | catch (Exception e) |
323 | { | 325 | { |