- use golang context pkg instead of gorilla/context to fix memory leaks#175
- use golang context pkg instead of gorilla/context to fix memory leaks#175elithrar merged 3 commits intogorilla:masterfrom
Conversation
|
This change won't work with golang versions below 1.7 as the context pkg did not exist for those versions |
elithrar
left a comment
There was a problem hiding this comment.
Couple of last requests, @secracon -
- Update
doc.goto remove reference to the memory leak from the old context implementation - https://github.com/gorilla/sessions/blob/master/doc.go#L62 - The same again in
README.mdhttps://github.com/gorilla/sessions/blob/master/README.md#L62 - Update
.travis.ymlto only build from Go 1.7.x onwards
Let me know if you need me to pick this up if you're unable to find time.
|
Thanks @secracon! |
|
You're welcome! |
giganteous
left a comment
There was a problem hiding this comment.
The go.mod file still references github.com/gorilla/context. Did you run go mod tidy?
|
Hi @elithrar, will there be a tagged release with this change? The latest tag Reason being is that as a consumer I want to avoid locking down to a commit and rely on semver instead so my dep manager does the heavy lifting. |
|
I think @elithrar will release a minor version when he can find time. |
If gorilla/sessions is used together with other solutions including gorilla/mux, then there is a big chance of memory leaks, because the request may change during it's lifetime due to shallow copying of the request when the request context is changing. Once the request is copied, and that copy is used instead, then the request can no longer be found as key in the global context store managed by gorilla/context. This way the expired contexts are remaining in memory forever.