Comments (15)
Thanks for reporting. I will have a look.
from resty.
@iyidan I have analyzed it, will be available in next version. If you have PR for this, feel free to send it.
from resty.
@iyidan - I have taken care of it, however will do improvements later.
from resty.
It will be part of v0.8 release, available in master
branch.
from resty.
Sorry to resurrect this, just to let you know: This has broken my client as resty is not parallel anymore. I knew about the data race but it was not affecting my use case. I can fix it without much issues, but please be careful in the future about changes that change the behavior of resty so much. Thanks for the library, will keep using it! :)
from resty.
@mrd0ll4r I'm sorry about you ran into issue.
Please let me know your suggestion to improve resty. I will think about keeping parallel and prevent data race in the mean time.
Looking forward to your inputs.
from resty.
Hard to say - you could use an RWMutex
for the proxy settings etc, but you allow setting a proxy for an individual Request, so that's not going to work. Maybe make it so that requests with an explicit proxy use a separate transport and HTTP client? Hard to say for sure.
You could always just say "resty is not thread safe when modifying proxy settings (and maybe more), do thread safety in your code", which works fine for me.
from resty.
@mrd0ll4r @wanghq - I thought through it. I'm planning to remove request level proxy option and mutex locking from resty.
any objections or comment?
from resty.
You'd still protect the top-level proxy with an RWMutex
or something, right? Sounds good to me.
from resty.
@mrd0ll4r that's the plan, I'm gonna give it try.
from resty.
@mrd0ll4r @wanghp - mutex lock is removed from resty. I have tried RWMutex however it is not needed anymore.
I need to add note for, if resty user is modifying resty client setting from multiple goroutine/dynamically they have to use their own locking mechanism.
I have pushed changes to master. resty Performance is improved.
from resty.
@jeevatkm , thanks for the quick response! Looks good.
from resty.
@wanghq have you tested master
at your end. Please let me know your feedback.
from resty.
@jeevatkm , I didn't notice any issue with the master branch. Thanks again.
from resty.
@wanghq Thank you for the confirmation.
from resty.
Related Issues (20)
- CVE-2023-45286 HOT 3
- Breaks application from Ctrl-C handling HOT 1
- Brotli support HOT 1
- How to handle response if a call to API returns 200 with struct A, or 201 with struct B? HOT 3
- SetResult failed with httpmock HOT 2
- CVE-2023-45286: HTTP request body disclosure HOT 3
- SetProxy HOT 3
- The request with SetFileReader retry time great than 1 will has issues HOT 1
- Signing requests with path parameters HOT 1
- Clone or copy of existing client HOT 6
- cache middleware HOT 4
- retrying of non-idempotent methods HOT 2
- Path param encoding is broken
- can't use image.decode on rawbody HOT 1
- Can it support socket5 proxy? HOT 2
- Resty retry function does not work in Slack as custom http client HOT 1
- Middleware around resty.Request.Execute including retries HOT 1
- about proxy
- Client: Improve its creation flow and its options
- Request: Improve Request struct and its usage
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from resty.