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

Fix: kc-cron-job hanging #319

Merged
merged 11 commits into from
Oct 18, 2023
Merged

Fix: kc-cron-job hanging #319

merged 11 commits into from
Oct 18, 2023

Conversation

jlangy
Copy link
Contributor

@jlangy jlangy commented Oct 18, 2023

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.

prevent zip-logs hanging on error
add github action to run unit tests
use relative path in github action
add github action into path trigger
remember to checkout in gh action
test why mkdir failing in CI
test why mkdir failing in CI
explicitly set root-dir for jest
add jest config into dockerignore
use more robust dirname for CI
make fixtures dir in test in NA
@jlangy jlangy added the bug Something isn't working label Oct 18, 2023
@jlangy jlangy merged commit 285040b into dev Oct 18, 2023
3 checks passed
@jlangy jlangy deleted the ssoteam-396 branch October 18, 2023 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants