From 335518a115275f7a086dcebf43219e20036a3e6c Mon Sep 17 00:00:00 2001 From: Adityya Kaushal <52387864+Adityya-K@users.noreply.github.com> Date: Wed, 22 Jan 2025 18:32:05 -0500 Subject: [PATCH] Restart workers patch with fixes (#243) * restart worker patch with fixed commit history * fixed black error for CI/CD * fixed pylint error for CI/CD * fixed pylint error for CI/CD * added submodules * added data checking to communication worker * fixed code that was commented on during review * fixed logging messages and deleted deprecated code * formatted code with black --- modules/cluster_estimation/cluster_estimation_worker.py | 4 +++- modules/communications/communications_worker.py | 4 +++- modules/detect_target/detect_target_worker.py | 2 +- modules/geolocation/geolocation_worker.py | 2 +- utilities/workers/worker_manager.py | 7 ------- 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/modules/cluster_estimation/cluster_estimation_worker.py b/modules/cluster_estimation/cluster_estimation_worker.py index bd857e3e..0f378625 100644 --- a/modules/cluster_estimation/cluster_estimation_worker.py +++ b/modules/cluster_estimation/cluster_estimation_worker.py @@ -84,7 +84,9 @@ def cluster_estimation_worker( for single_input in input_data: if not isinstance(single_input, detection_in_world.DetectionInWorld): - local_logger.warning(f"Skipping unexpected input: {input}") + local_logger.warning( + f"Skipping unexpected input: {input_data}, because of unexpected value: {single_input}" + ) is_invalid = True break diff --git a/modules/communications/communications_worker.py b/modules/communications/communications_worker.py index 6e5f3b66..3b25dc85 100644 --- a/modules/communications/communications_worker.py +++ b/modules/communications/communications_worker.py @@ -70,7 +70,9 @@ def communications_worker( for single_input in input_data: if not isinstance(single_input, object_in_world.ObjectInWorld): - local_logger.warning(f"Skipping unexpected input: {input}") + local_logger.warning( + f"Skipping unexpected input: {input_data}, because of unexpected value: {single_input}" + ) is_invalid = True break diff --git a/modules/detect_target/detect_target_worker.py b/modules/detect_target/detect_target_worker.py index 17b5cf43..336e1276 100644 --- a/modules/detect_target/detect_target_worker.py +++ b/modules/detect_target/detect_target_worker.py @@ -69,7 +69,7 @@ def detect_target_worker( break if not isinstance(input_data, image_and_time.ImageAndTime): - local_logger.warning(f"Skipping unexpected input: {input}") + local_logger.warning(f"Skipping unexpected input: {input_data}") continue result, value = detector.run(input_data) diff --git a/modules/geolocation/geolocation_worker.py b/modules/geolocation/geolocation_worker.py index 4e7ac6d7..0be882e0 100644 --- a/modules/geolocation/geolocation_worker.py +++ b/modules/geolocation/geolocation_worker.py @@ -60,7 +60,7 @@ def geolocation_worker( break if not isinstance(input_data, merged_odometry_detections.MergedOdometryDetections): - local_logger.warning(f"Skipping unexpected input: {input}") + local_logger.warning(f"Skipping unexpected input: {input_data}") continue result, value = locator.run(input_data) diff --git a/utilities/workers/worker_manager.py b/utilities/workers/worker_manager.py index fcf8cdfb..d52f9436 100644 --- a/utilities/workers/worker_manager.py +++ b/utilities/workers/worker_manager.py @@ -244,11 +244,4 @@ def check_and_restart_dead_workers(self) -> bool: self.__workers = new_workers - # Draining the preceding queue ensures that the preceding queue data wasn't what - # caused the worker to fail. Draining the succeeding queues is not needed - # because a worker that died would not have put bad data into the queue. - # input_queues = self.__worker_properties.get_input_queues() - # for queue in input_queues: - # queue.drain_queue() - return True