-
Notifications
You must be signed in to change notification settings - Fork 53
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
Data method is not thread safe. #13
Comments
could you add some tests on this? |
I am not sure how to make this tests not so ugly ) |
It cause panic only if use go 1.6. I am not sure how to test it on previous versions. |
It seem that the returns of Data() function include the maps (references) from Stats structure, any further access to those maps is not protected by RWMutex (privated in Stats) |
Hi!
|
Ping @thoas :) |
will look into this, you can send me a PR if you want :) |
fixed |
reopening still not fixed |
fixed in master |
Though this method is protected by lock and create a new structure on every call, this structure still use the same instance of ResponseCounts. So it is possible that somebody would read this map in the same moment as EndWithStatus would write into it.
In go 1.6 it will cause a panic.
The text was updated successfully, but these errors were encountered: