Commit d7d62c04 authored by Reto Da Forno's avatar Reto Da Forno
Browse files

limit #CPUs to 1 to avoid collisions (functions are not thread safe)

parent 61a9f0ef
......@@ -989,6 +989,10 @@ def main(argv):
# Start a worker process pool for every service:
for service, cpus in service_pools_dict.items():
if cpus != 1:
# currently only 1 CPU / process can be used per task since processing functions are NOT thread safe!
logger.warning("%d is an invalid number of CPUs for service %s, using default value of 1." % (cpus, service))
cpus = 1
if cpus > 0:
pool = multiprocessing.Pool(processes=cpus)
logger.debug("Created pool for %s workers with %d processes" % (service, cpus))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment