This repository was archived by the owner on Mar 28, 2023. It is now read-only.
This repository was archived by the owner on Mar 28, 2023. It is now read-only.
Inbound Message Scanner retries failures indefinitely #1900
Open
Description
After analyzing the error logs being returned from TestPerformTaskInboundMessageScanner
in core/inbound_message_scanner_test.go
I found the PerformTask function to never omit records which produce errors during processing, only marking them as resolved if completing the task sucessfully.
This problem also indicates that our unit test does not provide any error output for PerformTask for feedback about worker failures, which was occurring in this unit test due and being missed.
I recommend the following improvements:
- PerformTask should return errors and make error handling a function of the caller
- The unit test should provide a fake logger which pipes logger calls into the test (Ex: log.Error will trigger a t.Error call with the error content or log.Info will similarly trigger t.Log. Appropriate log levels triggering appropriate test reporting.)
- Fix the InboundMessageScanner.PerformTask logic to handle errors so they resolve to a final state instead of skipping over the record for them to repeat the same path on next Perform.