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 loki log output exiting before push is finished #3194
Conversation
After #2833 log outputs were stopped but loki didn't wait until it push was finished to signal it was done. Which leads to the actual k6 process exiting before loki could flush its messages.
pushDone := make(chan struct{}) | ||
defer func() { <-pushDone }() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did use a sync.WaitGroup in thePoC, but decided there is no need to import the sync
package and this code is even shorter so 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this code is complex and maybe not so easy, but it would be good to have a fixed test that fails without this patch.
Up to you if you have time for it.
Codecov Report
@@ Coverage Diff @@
## master #3194 +/- ##
==========================================
- Coverage 72.88% 72.85% -0.04%
==========================================
Files 256 256
Lines 19800 19803 +3
==========================================
- Hits 14431 14427 -4
- Misses 4469 4475 +6
- Partials 900 901 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
My original code was fixing the problem in totally different place, which was going to make the test .... really hard to write. But later I found out that ... the fix both didn't work and I didn't need to make it outside as the bug was actually in loki log output to begin with. I am going to try to figure out if this is fairly easy to fix. |
After #2833 log outputs were stopped but loki didn't wait until it push was finished to signal it was done.
Which leads to the actual k6 process exiting before loki could flush its messages.