Убрать шум финализаторов очереди при завершении цикла
queue.close()+join_thread() после writer.join(): иначе семафоры очереди финализируются в гонке с resource_tracker на выходе интерпретатора и после каждого цикла в журнал сыпалось «Exception ignored … sem_unlink FileNotFoundError». Проверено репродукцией: stderr пуст. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -199,6 +199,11 @@ def run_evolution(
|
|||||||
break
|
break
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
continue # уже завершаемся; ждём писателя до конца
|
continue # уже завершаемся; ждём писателя до конца
|
||||||
|
# явно закрыть очередь: иначе её семафоры финализируются в гонке с
|
||||||
|
# resource_tracker на выходе интерпретатора и сыплют в журнал
|
||||||
|
# «Exception ignored … sem_unlink FileNotFoundError» после каждого цикла
|
||||||
|
queue.close()
|
||||||
|
queue.join_thread()
|
||||||
logger._write("база дописана полностью")
|
logger._write("база дописана полностью")
|
||||||
|
|
||||||
assert best_pair is not None
|
assert best_pair is not None
|
||||||
@@ -215,6 +220,8 @@ def run_evolution(
|
|||||||
conn_queue.put(build_run_record(polished_genome, polished_result, db, search_mode="evolve-polish"))
|
conn_queue.put(build_run_record(polished_genome, polished_result, db, search_mode="evolve-polish"))
|
||||||
conn_queue.put(None)
|
conn_queue.put(None)
|
||||||
polish_writer.join()
|
polish_writer.join()
|
||||||
|
conn_queue.close()
|
||||||
|
conn_queue.join_thread()
|
||||||
best_genome, best_result = polished_genome, polished_result
|
best_genome, best_result = polished_genome, polished_result
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user