-
Notifications
You must be signed in to change notification settings - Fork 123
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
Inability in usage of session-pool (NebulaPool) #322
Comments
@laura-ding , this seems to make sense, for the case(there indeed is such case) when we only make a few(i.e. one) queries, in a lifetime between session creation and release, the Is it possible to consider add options(not the default behavior to keep backward compatibilities) to enable a different connection release policy(something like signout_in_release=False), rather than calling This could be expensive for maintaining signed-in connections, while, if user is knowing what they are doing, it could be beneficial in certain case(as the above case) to save some What do you think, if it makes sense, I can prepare PR/proposal for it. Please correct me and @aminmaghsodi if something was misunderstood as well. Thanks! |
@aminmaghsodi Thanks for your questions. |
Thank you @laura-ding and @wey-gu By your approach and not using |
@aminmaghsodi If the connection is broken, then the session will automatically release the connection and mark it as broken. Then the session will get a valid connection from the pool. The user doesn’t need to worry about connection disconnection exception handling. Sessions and pools ensure the reliability of the connection. |
Thanks for your responses @laura-ding, So after this good discussion I understood that we don't have Thanks. |
As you see in all your examples, first you create a session pool with max-sessions=n, and then you pick just one Session to execute a command.
After your session creation, first, you execute "use space" and then you execute all your other commands by this Session object, the problem is that you cannot use session-pool correctly. why? because if you want to use it, per time you call session.release() it clears all states (it means it clears "use space") too. and in next time you should first call "use space; (and then your main command...)", and it increases the time of command execution (for example it increases INSERT time from 5 ms to 11 ms).
It looks like that it is better not to reset space declaration in release time and also it is helpfully to declare space name in CREATION phase of session-pool (take HostAddress, nebulaConfig, and space name)
The text was updated successfully, but these errors were encountered: