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

Clean only idle connections from pool [DNET638] #597

Closed
firebird-automations opened this issue Oct 7, 2015 · 7 comments
Closed

Clean only idle connections from pool [DNET638] #597

firebird-automations opened this issue Oct 7, 2015 · 7 comments

Comments

@firebird-automations
Copy link

Submitted by: Hennadii Zabula (zabulus)

Votes: 2

We had run in a problem where currently running queries were failing because another thread wrongly cleared all pools. It was quite unexpected.

We fixed the issue in our code with the thread, but I think it should throw InvalidOperationException if _busy dictionary is not empty, because it means that there may be currently running queries.

The exception could add information about the problems caused by an inappropriate call to ClearPool.

Commits: 9e4c058

@firebird-automations
Copy link
Author

Commented by: @cincuranet

What I have in my head right now:

1. Clean only idle connections.
2. Throw exception if there's busy connection.
3. Provide overload for ClearPool, like force=true (or maybe the other way around).

I checked mysql-connector-net and Npgsql and both clean only idle connections and none has any "force" overload. Clearly 2 is out. Others are doing 1, so I don't see much value in 3.

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: Open [ 1 ] => In Progress [ 3 ]

@firebird-automations
Copy link
Author

Modified by: @cincuranet

Fix Version: vNextBig [ 10850 ]

@firebird-automations
Copy link
Author

Commented by: Hennadii Zabula (zabulus)

> 1. Clean only idle connections.
Yep, that's will be sufficient.

@firebird-automations
Copy link
Author

Modified by: @cincuranet

summary: Add exception when FbConnectionPoolManager.ClearPools used inapropriately => Clean only idle connections from pool

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: In Progress [ 3 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

@firebird-automations
Copy link
Author

Modified by: @cincuranet

summary: Clean only idle connections from pool => Clean only idle connections from pool #⁠breaking

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants