Ecdc-3496 send cmd errors on instrument topic
Issue
ECDC-3496
When the file-writer sends a run_start response with errors, it sends the response to the default topic instead of the instrument topic specified in the run_start message. The behaviour is observed sporadically in production, but consistently in local testing.
Description of work
We fix two related issues:
- When a start_run message results in an error that prevents the job from starting, we now delay the switch to the default command topic until after the Answer message is sent back.
- When a FinishedWriting message is sent, we did not revert to the default topic if the FinishedWriting was unsuccessful.
Checklist
-
Changes have been documented in changes.md
-
Documentation has been updated in documentation
directory