-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Limit number of sessions that are created by same client ip and same user for each graphd #3729
Conversation
Limiting the number of individual user connections is required in a multi tenant cluster. It can prevent one user's mistake from affecting all other users |
@CPWstatic this PR has been open for a long time, please take a look and give feedback. thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for being back late, and thank you for addressing this problem.
Please take a look at the comments.
LGTM. |
I have fixed the format reported, I find that there is not any whitespace at line ending in code. Why did they report an error? |
You could use |
@Aiee I have formated code by |
Please check https://github.com/vesoft-inc/nebula/runs/5489976984?check_suite_focus=true |
Unfortunately, it is mandatory to sign the CLA. You could add the email address used for this commit to your account and may remove your working email later. |
@Aiee |
@a516072575 Please take a look at the failed pytest case. You could run the test locally before pushing the commit. |
https://github.com/vesoft-inc/nebula/runs/5533203149?check_suite_focus=true E nebula3.Exception.AuthFailedException: b"Create Session failed: Too many sessions created from 127.0.0.1 by user root. the threshold is 1. You can change it by modifying 'max_sessions_per_ip_per_user' in nebula-graphd.conf" |
Please add |
I will complete it as soon as possible |
I will fix it today |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We made it!
What type of PR is this?
What problem(s) does this PR solve?
Issue(s) number:
Description:
#3696 provides the ability to delete sessions offline after too sessions are created. It is too late to ensure cluster availability, I think that we should do something to avoid too many session being created. Now there is already max_allowed_connections to limit total number of sessions in cluster to make sure the cluster does not crash because there are too many sessions. But it is not unfair to users who correctly use clusters.
So I add max_sessions_per_ip_per_user configuration to limit the number of sessions that are created by same client ip and same user on a graphd service . The default value is 300, You can set it in nebula-graphd.conf file.
How do you solve it?
So I add max_sessions_per_ip_per_user configuration to limit the number of sessions that are created by same client ip and same user on a graphd service . The default value is 300, You can set it in nebula-graphd.conf file.
Special notes for your reviewer, ex. impact of this fix, design document, etc:
Checklist:
Tests:
Affects:
Release notes:
Please confirm whether to be reflected in release notes and how to describe: