Skip to content
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

bug: session leak #6560

Closed
1 of 2 tasks
dantengsky opened this issue Jul 9, 2022 · 2 comments · Fixed by #6672
Closed
1 of 2 tasks

bug: session leak #6560

dantengsky opened this issue Jul 9, 2022 · 2 comments · Fixed by #6672
Assignees
Labels
C-bug Category: something isn't working

Comments

@dantengsky
Copy link
Member

dantengsky commented Jul 9, 2022

Search before asking

  • I had searched in the issues and found no similar issues.

Version

b9e8582

What's Wrong?

object Session leaks

How to Reproduce?

# enable memory-profiling
cargo b  -p databend-query --features memory-profiling
# fire up databend-query
MALLOC_CONF=prof:true ./target/debug/databend-query --log-level=error

keep creating new sessions and quit, and then differ the memory

curl http://localhost:8080/debug/mem/pprof/profile > base_profile
for i in {1..1000}; do echo "select 1;" | mysql -h 127.0.0.1  -P3307 -uroot -s  -N > /dev/null; done
curl http://localhost:8080/debug/mem/pprof/profile > after_inserts
jeprof ./target/debug/databend-query --base=base_profile after_inserts --pdf > session_leak.pdf
evince session_leak.pdf

and then, got something like this, which indicates memory leaks:

session_leaks-1

session_leak.pdf

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@dantengsky dantengsky added the C-bug Category: something isn't working label Jul 9, 2022
@zhang2014 zhang2014 self-assigned this Jul 10, 2022
@zhang2014 zhang2014 removed their assignment Jul 11, 2022
@ClSlaid
Copy link
Contributor

ClSlaid commented Jul 11, 2022

Could it be solved by reimplementing it?
I had proposed #6306.

@zhang2014
Copy link
Member

Could it be solved by reimplementing it?
I had proposed #6306.

It‘s a great idea to use the actor model to reimplement the session, but we may need to solve more problems, such as the complexity of the code when we need to return results(timeout, exchange channel, dead message and more). This may require some discussions and detailed design (RFC) and a lot of extra work, this almost requires the implementation of an actor system on tokio (such as akka), which is too complex for us. so let's try fixes this first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants