-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
🐛 bug fix: make sure logs from threads in replication workers are added… #3874
Conversation
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.
WHat are the good practices for the mgmt of MDC? the current handling looks brittle.
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.
This is tricky!
For discussion sake: maybe there should be an airbyte-commons function that we only use to create callables/runnables? this common function can also make sure MDC is set.
I'm merging this in since I'm also dealing with some logging issues while working on Kube and I want to get all the bug fixes in to stabilise things. |
@michel-tricot this is a good question. I agree the current approach is brittle. I've hunted around a little bit and I'm not finding a solution that I love. Some of the sources that I've ready. SO, article, article. I think the option described in the last article is the one I dislike least (and is closest to what @davinchia suggested as well). Essentially we can create a static factory helper in airbyte commons that passes the MDC from parent to child. |
Actually I experimented with that implementation and I think it's a terrible idea. The issue is that if you ever run the Runnable in the parent thread (e.g. |
… to log file
closes #3824
What
ReplicationWorker
that are executed via anExecutorService
. We rely on metadata in theMDC
to make sure that log lines are appended to our log file. Because in java the MDC of the parent thread is not by default passed to threads executed in anExecutorService
, STDOUT of the newly introduced threads was not making it into the log file.How