-
Notifications
You must be signed in to change notification settings - Fork 0
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(router): avoid settings logger from request due to race conditions #70
Conversation
Hmm, why CI is all red? 🤔 |
because it's blocked by this change: EmerisHQ/emeris-utils#37 I don't know the best practice of managing this kind of changes across multiple repositories :/ |
@antonio The allinbits/emeris-utils#37 PR needs to be marked with |
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.
Now that setLoggerFromContext
is removed, I think we need to use the AddCorrelationIDToLogger
in deps.LogError
and deps.WriteError
too, so that the correlation id's get included there.
The deps logger already contains the correlation id, right? It should be set by the CorrelationIDMiddleware you wrote. |
Could run this locally and check if the logRequest and deps include correlationIds? |
@SpideyPool192 I see your point. I didn't understand that the middleware was setting a logger inside the gin.context, but we weren't using it 😅 So my last commit: Eventually in my head the whole deps package will go away, since all the deps are "static" (aka not depending on the particular HTTP request, they are the same for everyone), expect for the logger (so only the logger will be treated differently). But that's for the future :) |
We already have a |
fc25f38
to
5327870
Compare
amazing, thanks for pointing it out! I removed my method which basically was the same in favour of the utils one. |
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.
LGTM.
5327870
to
a69c256
Compare
a69c256
to
461aef0
Compare
This fixes failing code_cov tests due to a concurrency problem that I did point out here: #20 (comment).