Skip to content

Commit 02b6a42

Browse files
authored
chore(hardware): Add some logging around what I think is causing some can errors (#17117)
<!-- Thanks for taking the time to open a Pull Request (PR)! Please make sure you've read the "Opening Pull Requests" section of our Contributing Guide: https://github.com/Opentrons/opentrons/blob/edge/CONTRIBUTING.md#opening-pull-requests GitHub provides robust markdown to format your PR. Links, diagrams, pictures, and videos along with text formatting make it possible to create a rich and informative PR. For more information on GitHub markdown, see: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax To ensure your code is reviewed quickly and thoroughly, please fill out the sections below to the best of your ability! --> # Overview We occasionally get some ABR issues where the can bus says it's not receiving ACKs or that a move group says it didn't get all expected nodes, but reports [] as the missing nodes. I think the second bug is because we're checking with `if not self._moves[group_id]` instead of checking `if len(self._moves[group_id]) == 0:` Which should be equivalent but I think there may be some python cleanup bug that reports the list as true due to a remnant that hasn't been garbage collected yet. <!-- Describe your PR at a high level. State acceptance criteria and how this PR fits into other work. Link issues, PRs, and other relevant resources. --> ## Test Plan and Hands on Testing <!-- Describe your testing of the PR. Emphasize testing not reflected in the code. Attach protocols, logs, screenshots and any other assets that support your testing. --> ## Changelog <!-- List changes introduced by this PR considering future developers and the end user. Give careful thought and clear documentation to breaking changes. --> ## Review requests <!-- - What do you need from reviewers to feel confident this PR is ready to merge? - Ask questions. --> ## Risk assessment <!-- - Indicate the level of attention this PR needs. - Provide context to guide reviewers. - Discuss trade-offs, coupling, and side effects. - Look for the possibility, even if you think it's small, that your change may affect some other part of the system. - For instance, changing return tip behavior may also change the behavior of labware calibration. - How do your unit tests and on hands on testing mitigate this PR's risks and the risk of future regressions? - Especially in high risk PRs, explain how you know your testing is enough. -->
1 parent b13cd27 commit 02b6a42

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

hardware/opentrons_hardware/drivers/can_bus/can_messenger.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ async def send_and_verify_recieved(self) -> ErrorCode:
152152
)
153153
except asyncio.TimeoutError:
154154
log.error(
155-
f"Message did not receive ack for message index {self._message.payload.message_index}"
155+
f"Message did not receive ack for message index {self._message.payload.message_index} Missing node(s) {self._expected_nodes}"
156156
)
157157
return ErrorCode.timeout
158158
finally:
@@ -278,12 +278,14 @@ async def _ensure_send(
278278
exclusive: bool = False,
279279
) -> ErrorCode:
280280
if len(expected_nodes) == 0:
281-
log.warning("Expected Nodes should have been specified")
282281
if node_id == NodeId.broadcast:
283282
if not expected_nodes:
284283
expected_nodes = list(self._known_nodes)
285284
else:
286285
expected_nodes = [node_id]
286+
log.warning(
287+
f"Expected Nodes should have been specified, Setting expected nodes to {expected_nodes}"
288+
)
287289

288290
listener = AcknowledgeListener(
289291
can_messenger=self,

hardware/opentrons_hardware/hardware_control/move_group_runner.py

+4
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,10 @@ def _remove_move_group(
469469
f"Received completion for {node_id} group {group_id} seq {seq_id}"
470470
f", which {'is' if in_group else 'isn''t'} in group"
471471
)
472+
if self._moves[group_id] and len(self._moves[group_id]) == 0:
473+
log.error(
474+
f"Python bug proven if check {bool(not self._moves[group_id])} len check {len(self._moves[group_id]) == 0}"
475+
)
472476
if not self._moves[group_id]:
473477
log.debug(f"Move group {group_id+self._start_at_index} has completed.")
474478
self._event.set()

0 commit comments

Comments
 (0)