Skip to content

Conversation

@P3TE
Copy link
Contributor

@P3TE P3TE commented Oct 28, 2021

So in an ideal scenario, topicInfo.OnMessageReceived(contents); always works fine, but malformed messages or bad code means that sometimes that's not always the case. The idea behind this change is that even if topicInfo.OnMessageReceived(contents); does throw an exception, it will just move on to the next received message in the queue. Without this the Update method of the ROSConnection will exit this frame and any other waiting messages will be forced to wait for the next frame. If you have some bad actor that throws an exception every frame, you could have an unbounded queue size and messages will never get received.

Provide any relevant links here.

Types of change(s)

  • Bug fix/workaround
  • New feature
  • Code refactor
  • Documentation update
  • Other (please describe)

Testing and Verification

Please describe the tests that you ran to verify your changes. Please also provide instructions, ROS packages, and Unity project files as appropriate so we can reproduce the test environment.

Test Configuration:

  • Unity Version: [e.g. Unity 2021.2.0b13]
  • Unity machine OS + version: [e.g. Ubuntu 18.04]
  • ROS machine OS + version: [e.g. Ubuntu 18.04, ROS Melodic]

Checklist

  • Ensured this PR is up-to-date with the dev branch
  • Created this PR to target the dev branch
  • Followed the style guidelines as described in the Contribution Guidelines
  • Added tests that prove my fix is effective or that my feature works
  • Updated the Changelog and described changes in the Unreleased section
  • Updated the documentation as appropriate

Other comments

…ause the Update method to exit without processing other received messages.
@hyounesy hyounesy changed the title Add a try catch so that bad logic from one received message doesn't c… AIRO-1464 Add a try catch so that bad logic from one received message doesn't c… Oct 29, 2021
@peifeng-unity
Copy link
Contributor

I am going to merge this PR to external-intermediate branch first because Yamato cannot be triggered from an external forked repo.

@peifeng-unity peifeng-unity changed the base branch from dev to external-intermediate November 8, 2021 22:02
@peifeng-unity
Copy link
Contributor

Will merge this PR and create a new one from external-intermediate to dev.

@peifeng-unity peifeng-unity merged commit 659b617 into Unity-Technologies:external-intermediate Nov 8, 2021
peifeng-unity added a commit that referenced this pull request Nov 8, 2021
…ause the Update method to exit without processing other received messages. (#227) (#233) Co-authored-by: Hamid Younesy <hyounesy@users.noreply.github.com> Co-authored-by: Peter Smith <p96.smith@qut.edu.au> Co-authored-by: Hamid Younesy <hyounesy@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants