]> git.openstreetmap.org Git - nominatim.git/commitdiff
do not run osm2pgsql append with mutliple threads
authorSarah Hoffmann <lonvia@denofr.de>
Thu, 5 Jan 2023 10:34:56 +0000 (11:34 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 22 Mar 2023 09:53:35 +0000 (10:53 +0100)
As the updates modify the placex table, there may be deadlocks
when different objects want to forward modifications to the same
place (for example because they are both linked to it).

nominatim/tools/exec_utils.py

index ed3bb53b3d8187cccae788942974dbd597f874a8..a452d297a4a906f3c606e3f0ed951343e3a23175 100644 (file)
@@ -118,7 +118,7 @@ def run_osm2pgsql(options: Mapping[str, Any]) -> None:
     cmd = [str(options['osm2pgsql']),
            '--hstore', '--latlon', '--slim',
            '--log-progress', 'true',
-           '--number-processes', str(options['threads']),
+           '--number-processes', '1' if options['append'] else str(options['threads']),
            '--cache', str(options['osm2pgsql_cache']),
            '--style', str(options['osm2pgsql_style'])
           ]