]> 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>
Thu, 5 Jan 2023 10:34:56 +0000 (11:34 +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 8417f146412c48fc08ccd2cced69c98c8557b6c5..566ac06edc57d4374b4979095866c64c1e959d60 100644 (file)
@@ -119,7 +119,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'])
           ]