openmicroscopy/openmicroscopy — pull request #1818 by will-moore (2013-11-21 15:20:10+00:00)
Title: Error handling of tile image loading in PanoJS See #11709

PR for discussion etc - Not ready to merge yet.

This attempts to address the issue seen in https://trac.openmicroscopy.org.uk/ome/ticket/11709 where tiles fail to load (due to ConcurrencyException) but are not re-loaded.

Here, tiles that fail to load are re-loaded after 1 second.
I have added a red background to tiles that failed to load, so you can see the effect (this can be removed once reviewed).
For failing tiles, you should see a red background for 1 second, then tile is reloaded and (hopefully) the correct image appears. If it fails to load a second time then we do not try to repeat the load.

This seems to work locally. Next feature is to offer the user a chance to manually refresh tiles that fail to load a second time - if that seems necessary in this PR?

I have been reproducing the failing tiles locally by adding these lines into BlitzGateway under setActiveChannels() to randomly recreate the effect of the ConcurrencyException.
```
@@ -6487,6 +6487,9 @@ class _ImageWrapper (BlitzObjectWrapper):
abs_channels = [abs(c) for c in channels]
idx = 0 # index of windows/colors args above
for c in range(len(self.getChannels())):
+ from random import random
+ if random() < 0.1:
+ self._re = None
self._re.setActive(c, (c+1) in channels, self._conn.SERVICE_OPTS)
if (c+1) in channels:
```