-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[docker log driver] Move pipeline check + creation to single atomic operation #14518
[docker log driver] Move pipeline check + creation to single atomic operation #14518
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.
File names should be lowercased.
|
||
var pipeline *Pipeline | ||
var err error | ||
pipeline, test := pm.pipelines[hashstring] |
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.
When using a hash as key I'm always a little woried about false-positives due to hash collisions. Have you considered to compute a key value instead of using a hash value?
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.
Added this to #13990
…peration (elastic#14518) * move pipeline check + creation to single atomic operation
Thanks to @urso for reminding me about this. I noticed it a while ago, but somehow it never made it into #13990.
The operation for checking if a pipeline exists, creating a new pipeline, and registering a new pipeline was three separate operations. This allowed a new thread to potentially squeeze in a create an identical pipeline before another thread registered it.
I'm still worried about the performance implications of this, since we're throwing around a global lock quite a lot. However, the most common use case will be one config with one pipeline.