Releases: palkan/isolator
1.1.0
1.0.0
Features
- Improved transactions tracking for Rails 7.1+ (handles closed connections and other edge cases)
- Add
Isolator.on_transaction_begin
andIsolator.on_transaction_end
callbacks - Add ability to track concurrent transactions within the same thread (e.g., to multiple databases)
This feature is disabled by default, opt-in via: Isolator.config.disallow_per_thread_concurrent_transactions = true
Changes
- Drop Ruby 2.6 and Rails 5 support
0.11.0
Changes
- Isolator use Rails new
transaction.active_record
event if available to better handle edge cases (connection closed in the middle of transactions, restarted savepoints)
0.7.0
This release brings two major features: multiple databases support and verbose output.
Multiple databases
Isolator was designed years ago with the assumption that there is only one DB connection per thread exists (which is true when you have a single DB pool). Since Rails 6, multi-database applications became more popular and revealed that this original assumption wasn't good enough to last for ages.
For this release, we refactored the internals to track connections separately, thus, supporting multiple databases.
NOTE: Although we tested this feature in multiple projects, there still could be some edge cases we're not aware of. Please, submit an issue if encounter problems with this release in your single- or multi-database application.
Thanks to @mquan and @bibendi for helping in implementing and testing this feature.
Debug output
Sometimes it's useful to know which actions initiated the transaction causing an Isolator exception. For that, you can now use a verbose logging feature of Isolator.
To enable Isolator logs, provide ISOLATOR_DEBUG=true
environment variable or manually via Isolator.debug_enabled
option, for example:
$ ISOLATOR_DEBUG=true bundle exec rspec
[ISOLATOR DEBUG] Threshold value was changed for connection 47316728757800: 2
[ISOLATOR DEBUG] Transaction opened for connection 47316728757800 (total: 1, threshold: 2)
↳ /app/lib/testing/shared_contexts/shared_user.rb:7:in `block (2 levels) in <main>'
...
By default, Rails.backtrace_cleaner
is used to filter the stacktrace. You can specify your own filter via Isolator.backtrace_cleaner
option:
Isolator.backtrace_cleaner = ->(locations) { locations.grep(/my_app/) }
You can also change the number of stack trace lines to display via ISOLATOR_BACKTRACE_LENGTH
environmental variable or manually via Isolator.backtrace_length
option.