File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
lib/mongo/cluster/reapers Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -123,11 +123,9 @@ def read_scheduled_kill_specs
123
123
db_name : db_name ,
124
124
service_id : service_id
125
125
)
126
- @mutex . synchronize do
127
- if @active_cursor_ids . include? ( kill_spec . cursor_id )
128
- @to_kill [ seed ] ||= Set . new
129
- @to_kill [ seed ] << kill_spec
130
- end
126
+ if @active_cursor_ids . include? ( kill_spec . cursor_id )
127
+ @to_kill [ seed ] ||= Set . new
128
+ @to_kill [ seed ] << kill_spec
131
129
end
132
130
end
133
131
end
@@ -144,11 +142,11 @@ def kill_cursors
144
142
# TODO optimize this to batch kill cursor operations for the same
145
143
# server/database/collection instead of killing each cursor
146
144
# individually.
147
-
148
145
loop do
149
146
server_address_str = nil
150
147
151
148
kill_spec = @mutex . synchronize do
149
+ read_scheduled_kill_specs
152
150
# Find a server that has any cursors scheduled for destruction.
153
151
server_address_str , specs =
154
152
@to_kill . detect { |server_address_str , specs | specs . any? }
You can’t perform that action at this time.
0 commit comments