Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Data bleeds between multiple instances of tileserver.php on same server when same tileset name is used #128

Open
bjnsn opened this issue Jun 13, 2018 · 0 comments

Comments

@bjnsn
Copy link

bjnsn commented Jun 13, 2018

This is the scenario I encountered:

You have two directories A and B each containing the default tileserver.php and a tileset tiles.mbtiles. A/tiles.mbtiles contains different data than B/tiles.mbtiles.

If you request A/tileserver.php?/tiles/7/8/9.pbf and then request B/tileserver.php?/tiles/6/7/8.pbf this second request will sometimes receive data from A/tiles.mbtiles rather than B/tiles.mbtiles.

This appears to be due to persistence within this line from DBConnect that is maintained without regard the tileset's full path:
$this->db = new PDO('sqlite:' . $tileset, '', '', array(PDO::ATTR_PERSISTENT => true));

Changing the dataRoot configuration so that the full path for tiles.mbtiles is passed to DBConnect fixes the issue. I would suggest switching the default configuration from $config['dataRoot'] = ''; to $config['dataRoot'] = __DIR__;.

This fixes the issue in my tests on:
Ubuntu + Nginx + PHP7.0-FPM
Ubutnu + Apache + PHP
OSX + PHP

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant