drolbr / Overpass-API

A database engine to query the OpenStreetMap data.
http://overpass-api.de
GNU Affero General Public License v3.0
692 stars 90 forks source link

Dispatcher reports wrong file location for shared memory file #637

Open lonvia opened 2 years ago

lonvia commented 2 years ago

After killing the dispatcher the hard way, it reports on startup:

vagrant@ubuntu2004:~$ sudo -u overpass /srv/overpass.openstreetmap.org/bin/dispatcher --osm-base --db-dir=/srv/overpass.openstreetmap.org/db --rate-limit=2 --space=10737418240
File_Error File exists 17 /osm3s_v0.7.57_osm_base Dispatcher_Server::1

The file in question is in fact /dev/shm/osm3s_v0.7.57_osm_base. The dispatcher should report the correct location here.

drolbr commented 2 years ago

Thank you for reporting, but this is a tricky one. The POSIX shared memory objects have by specification their own filesystem hierarchy, see e.g. man shm_open. It is only Linux that by convention mounts them on /dev/shm. It would be overengineering here to add a mechanism to figure out whether we are on Linux or on another POSIX conforming OS.

lonvia commented 2 years ago

A more informative message that clearly points out that this is a shared memory file would do as well in that case. The error message certainly shouldn't pretend to point to an absolute path when it doesn't know that path.

This message is the second of a File exists error. The first being for a file /srv/overpass/db/osm3s_v0.7.57_osm_base which I found and deleted. When afterwards the message above popped up, I falsely assumed it was still talking about the same file just looking for it in the wrong directory.