Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(hardware): Add some logging around what I think is causing some can errors #17117

Open
wants to merge 1 commit into
base: edge
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ async def send_and_verify_recieved(self) -> ErrorCode:
log.error(
f"Message did not receive ack for message index {self._message.payload.message_index}"
)
log.error(f"Missing node {self._expected_nodes}")
return ErrorCode.timeout
finally:
self._can_messenger.remove_listener(self)
Expand Down Expand Up @@ -284,6 +285,7 @@ async def _ensure_send(
expected_nodes = list(self._known_nodes)
else:
expected_nodes = [node_id]
log.warning(f"Setting expected nodes to {expected_nodes}")

listener = AcknowledgeListener(
can_messenger=self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,10 @@ def _remove_move_group(
f"Received completion for {node_id} group {group_id} seq {seq_id}"
f", which {'is' if in_group else 'isn''t'} in group"
)
if not self._moves[group_id] and len(self._moves[group_id]) == 0:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be self._moves[group_id] and len(self._moves[group_id]) == 0? this check: not self._moves[group_id] and len(self._moves[group_id]) == 0 is true if both are true, but aren't we asserting that a bug causes len(self._moves[group_id] == 0 to be true and not self._moves[group_id] to be false at the same time?

log.error(
f"Python bug proven if check {bool(not self._moves[group_id])} len check {len(self._moves[group_id]) == 0}"
)
if not self._moves[group_id]:
log.debug(f"Move group {group_id+self._start_at_index} has completed.")
self._event.set()
Expand Down