Skip to content

Potential race condition when REST calls are not guaranteed to complete in order #20

@aaronchongth

Description

@aaronchongth

Mentioned here: #16 (comment)

On this line and this line we're looking at the state reported by MiR, and if it gives us a READY result then we assume that it has reached the last waypoint that we commanded to it.

However, what happens if the system falls out of sync? For example, what if the following sequence happens:

  • fleet adapter sends mission request,
  • fleet adapter requests task state
  • MiR receives task state request and issues response that the robot is Ready
  • MiR receives mission request
  • fleet adapter receives confirmation of mission request
  • fleet adapter receives response that robot is Ready, which is taken to mean that the last mission request has already succeeded

This sequence may be improbable, but unless there's something in the REST API library to guarantee that the REST request/response ordering is FIFO, we have to consider that this sequence is possible. Packets dropping over wifi with TCP resending the requests + responses could allow this sequence to happen. I've certainly witnessed this kind of behavior in async systems that don't have message ordering guarantees.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions