Commit 0ee3494
fix(api-server): ignore duplicate task-api responses in RmfService (#1089)
RMF's request/response channel is a pub/sub pseudo-service, so more than one node can answer the same request_id (the RmfService docstring already notes clients must drop duplicated response ids). _handle_response dropped only *unknown* ids; for a known id it called fut.set_result() unconditionally.
A second response for an already-resolved future raises asyncio.InvalidStateError inside the subscription callback, which runs in the rclpy.spin() thread (ros.py) and terminates it. After that the api-server node stops processing every subscription, so all task-api calls time out with HTTP 500 "rmf service timed out" even though the request was delivered and executed.
Drop duplicate/late responses (fut.done()) so the spin thread survives, and add a regression test.
Signed-off-by: levonti <levonti@ileo.cloud>
Co-authored-by: levonti <levonti@ileo.cloud>1 parent 62ab379 commit 0ee3494
2 files changed
Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
97 | 109 | | |
98 | 110 | | |
99 | 111 | | |
| |||
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
0 commit comments