@@ -111,10 +111,9 @@ def nro_write_with_retry(_write_concern, context:, &block)
111111 error_count = 0
112112 error_to_raise = nil
113113 begin
114- result = server . with_connection ( connection_global_id : context . connection_global_id ) do |connection |
114+ server . with_connection ( connection_global_id : context . connection_global_id ) do |connection |
115115 yield connection , nil , context
116116 end
117- result
118117 rescue Error ::TimeoutError
119118 raise
120119 rescue *retryable_exceptions , Error ::PoolError , Error ::OperationFailure ::Family => e
@@ -253,7 +252,7 @@ def modern_write_with_retry(session, server, context, &block)
253252 connection_succeeded = false
254253 was_starting = false
255254
256- result = server . with_connection (
255+ server . with_connection (
257256 connection_global_id : context . connection_global_id ,
258257 context : context
259258 ) do |connection |
@@ -267,8 +266,6 @@ def modern_write_with_retry(session, server, context, &block)
267266 # it later for the retry as well.
268267 yield connection , txn_num , context . dup
269268 end
270-
271- result
272269 rescue *retryable_exceptions , Error ::PoolError , Auth ::Unauthorized , Error ::OperationFailure ::Family => e
273270 e . add_notes ( 'modern retry' , 'attempt 1' )
274271
@@ -343,10 +340,9 @@ def retry_write(original_error, txn_num, context:, failed_server: nil, &block)
343340
344341 attempt = attempt ? attempt + 1 : 2
345342 log_retry ( original_error , message : 'Write retry' )
346- result = server . with_connection ( connection_global_id : context . connection_global_id ) do |connection |
343+ server . with_connection ( connection_global_id : context . connection_global_id ) do |connection |
347344 yield ( connection , txn_num , context )
348345 end
349- result
350346 rescue *retryable_exceptions , Error ::PoolError => e
351347 if retryable_overload_error? ( e )
352348 e . add_notes ( 'modern retry' , "attempt #{ attempt } " )
0 commit comments