Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix for an issue where kc-cron-job pod was hanging indefinitely. It was difficult to say exactly what triggered the error, but it was caused by the promise wrapper of lineReader.close (event-logs.js line 61 in this pr) missing a rejection on error, so it just hung indefinitely, I could reproduce the exact same output triggering an error there.
An error can trigger there when inserting a log that was in an unexpected format, e.g a blank line or it's missing expected keys. I added error handling around that so it won't hang indefinitely, and will log out the error and problem log going forward.
I also added some additional checks in the log formatter to see if the JSON parse is failing, or some logs have a different set of keys than is expected. I added a unit test for malformed logs and to make sure it continues on to the rest on error, and put it in the CI pipeline so we can track what has been tested and not more easily.