This repository was archived by the owner on May 29, 2023. It is now read-only.
[fix]: memory leak in mod_dyups when ssl session reuse is enabled.#143
Open
timebug wants to merge 1 commit into
Open
[fix]: memory leak in mod_dyups when ssl session reuse is enabled.#143timebug wants to merge 1 commit into
timebug wants to merge 1 commit into
Conversation
Open
Author
|
ping @chobits |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi, @yzprofile
Issue #67 open for a long time, this problem also appeared in our online environment recently. I see @RocFang fix it just skip
set_sessionandsave_sessionfunction in PR #141, but after that will make proxy ssl session reuse not work.So, I redesigned
set_sessionandsave_sessionfunction, the new solution will solve memory leak issue and keep ssl session reuse work:ssl_sessiondata in the upstream related variable, not pre request related variable such asdyups_ctx, avoid losing after request complete.ssl_sessionmemory, it will destroy when free dynamic upstream or exit process.ngx_ssl_set_session(pc->connection, ssl_session)success.Steps to reproduce memory leak issue:
case1: (keepalive or no keepalive)
curl -H "Host: dyhost" -d "server 127.0.0.1:8089;server 127.0.0.1:8088;" 127.0.0.1:8081/upstream/dyhost -vfor i in {1..10000}; do curl -H "host: dyhost" 127.0.0.1:8080 -v; dcase2: (keepalive or no keepalive)
for i in {1..10000}; do curl -H "Host: dyhost" -d "server 127.0.0.1:8089;server 127.0.0.1:8088;" 127.0.0.1:8081/upstream/dyhost -v; donefor i in {1..10000}; do curl -H "host: dyhost" 127.0.0.1:8080 -v; d