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

Dispatcher only use websockets when dispatch fails #355

Merged
merged 3 commits into from
May 17, 2024

Conversation

aaronchongth
Copy link
Member

Bug fix

Fixed bug

This is not technically a bug, but rather a bit of a workaround due to tortoise/tortoise-orm#792

Due to this issue upstream (a fix for a newer version is on the way), there are occasions where the API server receives responses from the dispatcher via ROS 2 api response and websocket responses in quick succession where the DB still has no entry to the task ID yet.

Even with a mutex for this state save, it still doesn't resolve it.

This workaround only sends out a state update via websocket (if server URI is provided), when the task dispatch fails

This way, when a task dispatch succeeds, the API server will only hear from a single source, the ROS 2 API responses.

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
@aaronchongth aaronchongth marked this pull request as ready for review May 13, 2024 16:18
@aaronchongth aaronchongth changed the title Ac/ws dispatch failure Dispatcher only use websockets when dispatch fails May 13, 2024
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
@aaronchongth aaronchongth requested a review from arjo129 May 17, 2024 09:47
@aaronchongth aaronchongth merged commit 77c9f75 into main May 17, 2024
3 of 4 checks passed
@aaronchongth aaronchongth deleted the ac/ws-dispatch-failure branch May 17, 2024 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants