diff --git a/lib/mongo/session.rb b/lib/mongo/session.rb
index <HASH>..<HASH> 100644
--- a/lib/mongo/session.rb
+++ b/lib/mongo/session.rb
@@ -832,6 +832,7 @@ module Mongo
               end
               next
             else
+              transaction_in_progress = false
               raise
             end
           end
Fix RUBY-<I> Tx api loop breakage warnings in spec tests (#<I>)