Skip to content

Commit

Permalink
Restart workers patch with fixes (#243)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Adityya-K authored Jan 22, 2025
1 parent def8f2d commit 335518a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
4 changes: 3 additions & 1 deletion modules/cluster_estimation/cluster_estimation_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion modules/communications/communications_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion modules/detect_target/detect_target_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion modules/geolocation/geolocation_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 0 additions & 7 deletions utilities/workers/worker_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 335518a

Please sign in to comment.