From 83716c916b0dd8f547307eb80f65313f5588048b Mon Sep 17 00:00:00 2001 From: Olin Blodgett Date: Thu, 5 Jan 2023 17:46:25 -0500 Subject: [PATCH] Debug spawn type --- src/transactors/file_transactor.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/transactors/file_transactor.py b/src/transactors/file_transactor.py index 5f45aef..1836f3b 100644 --- a/src/transactors/file_transactor.py +++ b/src/transactors/file_transactor.py @@ -13,7 +13,9 @@ class FileTransactor(object): queue = None def __init__(self): - multiprocessing.set_start_method('fork') + logger.info("Spawn Type: " + multiprocessing.get_start_method()) + #multiprocessing.set_start_method('fork') + #multiprocessing.set_start_method("spawn") m = multiprocessing.Manager() FileTransactor.queue = m.Queue() self.filetracking_queue = m.list() @@ -53,9 +55,9 @@ def run(self, filetracking_queue): try: (sub_type, FileTransactor.count) = FileTransactor.queue.get() except EOFError as error: - logger.debug("Queue Closed exiting: %s" % error) + logger.info("Queue Closed exiting: %s" % error) return - logger.debug("%s: Pulled File Transaction Batch: %s QueueSize: %s " % (self._get_name(), FileTransactor.count, FileTransactor.queue.qsize())) + logger.info("%s: Pulled File Transaction Batch: %s QueueSize: %s " % (self._get_name(), FileTransactor.count, FileTransactor.queue.qsize())) self.download_file(sub_type, filetracking_queue) FileTransactor.queue.task_done() #EOFError @@ -64,19 +66,19 @@ def download_file(self, sub_type, filetracking_queue): filepath = sub_type.get_filepath() filepath_to_download = sub_type.get_file_to_download() - logger.debug("%s: Acquiring file: %s from filepath: %s" % (self._get_name(), filepath, filepath_to_download)) + logger.info("%s: Acquiring file: %s from filepath: %s" % (self._get_name(), filepath, filepath_to_download)) - logger.debug("%s: Checking whether the file is currently downloading: %s" % (self._get_name(), filepath_to_download)) + logger.info("%s: Checking whether the file is currently downloading: %s" % (self._get_name(), filepath_to_download)) if filepath_to_download in filetracking_queue: - logger.debug("%s: The file is already downloading, waiting for it to finish: %s" % (self._get_name(), filepath_to_download)) + logger.info("%s: The file is already downloading, waiting for it to finish: %s" % (self._get_name(), filepath_to_download)) while filepath_to_download in filetracking_queue: sleep(1) - logger.debug("%s: File no longer downloading, proceeding: %s" % (self._get_name(), filepath_to_download)) + logger.info("%s: File no longer downloading, proceeding: %s" % (self._get_name(), filepath_to_download)) sub_type.get_data() else: - logger.debug("%s: File not currently downloading, initiating download: %s" % (self._get_name(), filepath_to_download)) + logger.info("%s: File not currently downloading, initiating download: %s" % (self._get_name(), filepath_to_download)) filetracking_queue.append(filepath_to_download) sub_type.get_data() - logger.debug("%s: Download complete. Removing item from download queue: %s" % (self._get_name(), filepath_to_download)) + logger.info("%s: Download complete. Removing item from download queue: %s" % (self._get_name(), filepath_to_download)) filetracking_queue.remove(filepath_to_download)