-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Trivial - P5
-
None
-
Affects Version/s: None
-
Component/s: Sessions
-
1
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Currently the session pool suggests `end_sessions` method as the way of clearing itself, however this method's exception handler can stop execution prior to removing all sessions from the pool:
def end_sessions
while !@queue.empty?
server = ServerSelector.get(mode: :primary_preferred).select_server(@cluster)
Operation::Command.new(
:selector => {endSessions: @queue.shift(10_000).collect { |s| s.session_id }},
:db_name => Database::ADMIN).execute(server)
end
rescue
end
If the pool contains more than 10,000 sessions and there is an error removing the first 10,000, subsequent sessions won't be removed. If there is a problem selecting a server no sessions will be removed.
There should be a way to clear the pool client side even if sessions cannot be killed on the server.
- is related to
-
RUBY-1524 Driver session pools must be cleared after forking
-
- Closed
-