-
Notifications
You must be signed in to change notification settings - Fork 10
fix: Make goff unix socket client thread safe #74
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: Make goff unix socket client thread safe #74
Conversation
Summary of ChangesHello @AleksandrasMaliuginas-vinted, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical thread-safety concern within the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request aims to make the goff unix socket client thread-safe by using a thread-local UnixSocket instance. The approach of using a factory and Thread.current to manage per-thread socket instances is well-implemented and correctly addresses the thread-safety of the socket communication. The tests have also been updated accordingly to use the new factory pattern.
However, I've identified a couple of areas for improvement. There is a remaining thread-safety issue related to rate-limit handling, where the @retry_after instance variable is accessed without synchronization, which can lead to race conditions. Additionally, there's a potential memory issue with dynamic symbol creation for thread-local storage keys. I've added specific comments with details and suggestions for these points.
...ders/openfeature-go-feature-flag-provider/lib/openfeature/go-feature-flag/client/unix_api.rb
Show resolved
Hide resolved
...ders/openfeature-go-feature-flag-provider/lib/openfeature/go-feature-flag/client/unix_api.rb
Outdated
Show resolved
Hide resolved
Signed-off-by: Aleksandras Maliuginas <aleksandras.maliuginas@vinted.com>
4c626bd to
91cac6f
Compare
… after time Signed-off-by: Aleksandras Maliuginas <aleksandras.maliuginas@vinted.com>
Signed-off-by: Aleksandras Maliuginas <aleksandras.maliuginas@vinted.com>
Signed-off-by: Aleksandras Maliuginas <aleksandras.maliuginas@vinted.com>
117a797 to
d59e689
Compare
Signed-off-by: Aleksandras Maliuginas <aleksandras.maliuginas@vinted.com>
thomaspoignant
left a comment
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
Signed-off-by: Aleksandras Maliuginas <aleksandras.maliuginas@vinted.com>
🤖 I have created a release *beep* *boop* --- ## [0.1.8](openfeature-go-feature-flag-provider/v0.1.7...openfeature-go-feature-flag-provider/v0.1.8) (2026-01-13) ### 🐛 Bug Fixes * Make goff unix socket client thread safe ([#74](#74)) ([ec25c37](ec25c37)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Signed-off-by: OpenFeature Bot <109696520+openfeaturebot@users.noreply.github.com>
This PR
Related Issues
Notes
Follow-up Tasks
How to test