<html dir="ltr">
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style id="owaParaStyle">P {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
</style>
</head>
<body fPStyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">
<div>
<p>Hi list,</p>
<p> </p>
<p>I've got a bit of a bizarre issue with MapServer holding locks on MapProxy tiles.</p>
<p> </p>
<p>Our setup is: 4 x Windows Server 2008 running MapProxy 1.5.0 via WSGI in Apache, 1 x Windows Server 2008 running mapproxy-seed.exe in scheduled tasks, 1 x Windows Server 2008 storing the .yaml config files.</p>
<p> </p>
<p>Our four MapProxy instances are using sources of the WMS type that point back to the MapServer .exe locally i.e.
<a href="http://localhost/cgi-bin/mapserv.exe?map=something.map">http://localhost/cgi-bin/mapserv.exe?map=something.map</a></p>
<p> </p>
<p>In our log files from MapProxy and from mapproxy-seed we're periodically getting errors from lock.py line 124, e.g.</p>
<p> </p>
<p>[12:17:04]  7  75.00% 13775786.98567, -5465442.18332, 15654303.39280, -5009377.0<br>
8570 (477 tiles) ETA: 2013-01-07-12:17:25<br>
Exception in thread Thread-2:<br>
Traceback (most recent call last):<br>
  File "C:\Python27\Lib\threading.py", line 554, in __bootstrap_inner<br>
    self.run()<br>
  File "c:\pythonenv\mapproxy-srss\lib\site-packages\mapproxy-1.5.0a_20130107-py<br>
2.7.egg\mapproxy\seed\seeder.py", line 92, in run<br>
    self.work_loop()<br>
  File "c:\pythonenv\mapproxy-srss\lib\site-packages\mapproxy-1.5.0a_20130107-py<br>
2.7.egg\mapproxy\seed\seeder.py", line 104, in work_loop<br>
    exceptions=(SourceError, IOError), ignore_exceptions=(LockTimeout, ))<br>
  File "c:\pythonenv\mapproxy-srss\lib\site-packages\mapproxy-1.5.0a_20130107-py<br>
2.7.egg\mapproxy\seed\util.py", line 222, in exp_backoff<br>
    result = func(*args, **kw)<br>
  File "c:\pythonenv\mapproxy-srss\lib\site-packages\mapproxy-1.5.0a_20130107-py<br>
2.7.egg\mapproxy\cache\tile.py", line 126, in load_tile_coords<br>
    created_tiles = creator.create_tiles(uncached_tiles)<br>
  File "c:\pythonenv\mapproxy-srss\lib\site-packages\mapproxy-1.5.0a_20130107-py<br>
2.7.egg\mapproxy\cache\tile.py", line 227, in create_tiles<br>
    created_tiles = self._create_meta_tiles(meta_tiles)<br>
  File "c:\pythonenv\mapproxy-srss\lib\site-packages\mapproxy-1.5.0a_20130107-py<br>
2.7.egg\mapproxy\cache\tile.py", line 300, in _create_meta_tiles<br>
    created_tiles.extend(self._create_meta_tile(meta_tile))<br>
  File "c:\pythonenv\mapproxy-srss\lib\site-packages\mapproxy-1.5.0a_20130107-py<br>
2.7.egg\mapproxy\cache\tile.py", line 307, in _create_meta_tile<br>
    with self.tile_mgr.lock(main_tile):<br>
  File "c:\pythonenv\mapproxy-srss\lib\site-packages\mapproxy-1.5.0a_20130107-py<br>
2.7.egg\mapproxy\cache\tile.py", line 143, in lock<br>
    return self.cache.lock(tile)<br>
  File "c:\pythonenv\mapproxy-srss\lib\site-packages\mapproxy-1.5.0a_20130107-py<br>
2.7.egg\mapproxy\cache\base.py", line 115, in lock<br>
    cleanup_lockdir(self.lock_dir, force=False)<br>
  File "c:\pythonenv\mapproxy-srss\lib\site-packages\mapproxy-1.5.0a_20130107-py<br>
2.7.egg\mapproxy\platform\cpython\lock.py", line 124, in cleanup_lockdir<br>
    raise e<br>
WindowsError: [Error 32] The process cannot access the file because it is being<br>
used by another process: '\\\\10.0.0.70\\c_drive\\mapproxy\\cache\\layer7_fhs_la<br>
st_0_72.shp_EPSG900913\\tile_locks\\1d5b8827382a79fba940cc62e989aead-14883-6072-<br>
14.lck'</p>
<p> </p>
<p>Using Process Explorer I've managed to track the file locks down to the mapserv.exe process. In a typical case mapserv.exe will have locks on a PNG and a few of the .lck files. My understanding was that there's no link between the sources and the PNG tiles
 that MapProxy creates, so I'm at somewhat of a loss as to how mapserv.exe can come to have any knowledge of these PNG and .lck files.</p>
<p> </p>
<p>One pretty out-there thought we've had was that perhaps it's something to do with mapproxy-seed, Apache, and MapProxy all using the same user account and somehow because of that there's some shared file handle issue.</p>
<p> </p>
<p>Am I missing something obvious here? :)</p>
<p> </p>
<p>Cheers,</p>
<p> </p>
<p>Keith</p>
<p> </p>
<div style="FONT-FAMILY: Tahoma; FONT-SIZE: 13px">__________________________________
<br>
Keith Moss<br>
Satellite Remote Sensing Services<br>
Operations<br>
Landgate<br>
65 Brockway Road, FLOREAT WA 6014<br>
PO Box 741 Wembley WA 6913<br>
Ph. (08) 9387 0332 | Fx. (08) 9383 7142<br>
<a tabindex="0" href="mailto:keith.moss@landgate.wa.gov.au" target="">keith.moss@landgate.wa.gov.au</a><br>
<a tabindex="0" href="http://www.landgate.wa.gov.au/" target="">http://www.landgate.wa.gov.au/</a></div>
</div>
</div>
<p><span style="FONT-SIZE: 11pt; FONT-FAMILY: 'Arial'">This e-mail and any files transmitted with it are intended only for the use of the addressee(s). It may contain information that is confidential and privileged, in which case neither is intended to be waived or lost by mistaken delivery to you. If you are not an intended recipient, any use, interference with, disclosure, distribution or copying of this material is unauthorised and prohibited. If you receive this e-mail in error, please notify the sender by return e-mail and delete the message and any attachments from your system. Unless specifically indicated, this e-mail does not constitute formal advice or commitment by the sender or the Western Australian Land Information Authority (Landgate). Information in this message not relating to the official business of Landgate shall be understood as neither given nor endorsed by it. It is your responsibility to check any attachments for viruses and defects before opening or sending them on. Landgate’s liability is limited to re-supplying affected attachments.</span></p>
</body>
</html>