[Tilecache] Locking mechanism when generating new tiles?

Ivan Mincik ivan.mincik at gista.sk
Mon Feb 22 11:00:55 EST 2010


On Monday 22 February 2010, you wrote:
> On Mon, 22 Feb 2010, Ivan Mincik wrote:
> > Hi, which TileCache version do You use ?
>
>    We are using 2.10
>
> > There is a bug when using Metatiles which can be the case. (Patch r391
> > from SVN - broken locking when creating metaTiles)
>
>    Is there a quick way with the web access to subversion to view that
> specific patch?
>
> > --
> > Ivan

It should be following patch:

diff -r 5f72a7a82c68 -r c2b6e449466d tilecache-2.03/TileCache/Caches/Disk.py
--- a/tilecache-2.03/TileCache/Caches/Disk.py   Tue Aug 04 17:05:16 2009 +0200
+++ b/tilecache-2.03/TileCache/Caches/Disk.py   Tue Aug 04 17:24:44 2009 +0200
@@ -19,7 +19,7 @@
         if not self.access(base, 'read'):
             self.makedirs(base)

-    def makedirs(self, path):
+    def makedirs(self, path, hide_dir_exists=True):
         old_umask = os.umask(self.umask)
         try:
             os.makedirs(path)
@@ -29,7 +29,7 @@
             # catch errors. This lets 'directory exists' errors pass through,
             # since they mean that as far as we're concerned, os.makedirs
             # has 'worked'
-            if E.errno != 17:
+            if E.errno != 17 or not hide_dir_exists:
                 raise E
         os.umask(old_umask)

@@ -95,7 +95,7 @@
     def attemptLock (self, tile):
         name = self.getLockName(tile)
         try:
-            self.makedirs(name)
+            self.makedirs(name, hide_dir_exists=False)
             return True
         except OSError:
             pass


-- 
Ivan 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.osgeo.org/pipermail/tilecache/attachments/20100222/c9b5bde5/attachment.bin


More information about the Tilecache mailing list