diff --git a/bittensor/utils/registration.py b/bittensor/utils/registration.py index 6c504b05f1..fb9cdcde20 100644 --- a/bittensor/utils/registration.py +++ b/bittensor/utils/registration.py @@ -3,6 +3,7 @@ import hashlib import math import multiprocessing +import multiprocessing.queues # this must be imported separately, or could break type annotations import os import random import time @@ -1082,11 +1083,14 @@ def _solve_for_difficulty_fast_cuda( def _terminate_workers_and_wait_for_exit( - workers: List[multiprocessing.Process], + workers: List[Union[multiprocessing.Process, multiprocessing.queues.Queue]], ) -> None: for worker in workers: - worker.terminate() - worker.join() + if isinstance(worker, multiprocessing.queues.Queue): + worker.join_thread() + else: + worker.join() + worker.close() def create_pow(