fibered_mysql2 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7483b06b33f48ad81f0b2edd4418131ff11342f8beb9de37a4b76e01b413e94a
4
- data.tar.gz: ce2ba19419f9084c016cbe300b286b3ff16a2cd57a8efaac723be594bee42d52
3
+ metadata.gz: 48308ffbe571baaa919c2f198d761657f9f77b95a87f67c3ef7493433a3e4a6a
4
+ data.tar.gz: c5893a679a730bfd7e1a088a06f86b82d65c95da9b9171fcb419f27298ca268c
5
5
  SHA512:
6
- metadata.gz: 858251652fc0688fa3eee890a9d91409122e27ce174af91cd0906e9f74ec527f60f66b1daa909616e04359e5bf5c829b447cd1bf06a05673528864b66486ed28
7
- data.tar.gz: 11b45c4acaa50c6f5ee6c6cfb2eb0526ebf4aba9c0f0561c5f47ee9ba4ae5b24326b4ab542247c64d460ecf640f748f81bae7621ff1681fa10cda7bf7412be88
6
+ metadata.gz: af9979eb4a038db1fcbec58dc5a88d617a71271c1588ff0717a4792f5442b3c59d82e9bc8d76b59821179099c87c8387a72bbbcdb096d10991320e7001c4bda8
7
+ data.tar.gz: 05a912e4b5504aebfb6a0ad5e8a29e72cb8e739066279982ead7aa89ca97b9308f2144ed6142833cba84ad7939c8ee0d364e71065606221ebe52cf4ee35ce0e1
data/Appraisals CHANGED
@@ -9,5 +9,5 @@ appraise 'rails-5' do
9
9
  end
10
10
 
11
11
  appraise 'rails-6' do
12
- gem 'rails', '~> 6.0'
12
+ gem 'rails', '~> 6.0.0'
13
13
  end
data/CHANGELOG.md CHANGED
@@ -4,6 +4,14 @@ Inspired by [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
5
  Note: this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.1.1] - 2021-02-12
8
+ ### Fixed
9
+ - Fixed bug with Rails 5+ adapter where connections that have `steal!` called on them were not having their owner updated to the current Fiber, which would then cause an exception when trying to expire the connection (this showed up with the Rails 5 `ConnectionPool::Reaper` that reaps unused connections)
10
+
11
+ ### Changed
12
+ - Updated Rails 6 dependency to 6.0.x for now as 6.1+ requires a newer version of the mysql gem (0.5+) that we do not yet support
13
+
14
+
7
15
  ## [0.1.0] - 2020-10-23
8
16
  ### Added
9
17
  - Added an adapter for Rails 4, 5, and 6.
@@ -11,4 +19,5 @@ Note: this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0
11
19
  - Added TravisCI unit test pipeline.
12
20
  - Added coverage reports via Coveralls.
13
21
 
22
+ [0.1.1]: https://github.com/Invoca/fibered_mysql2/compare/v0.1.0..v0.1.1
14
23
  [0.1.0]: https://github.com/Invoca/fibered_mysql2/tree/v0.1.0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fibered_mysql2 (0.1.0)
4
+ fibered_mysql2 (0.1.1)
5
5
  em-synchrony (~> 1.0)
6
6
  rails (>= 4.2, < 7)
7
7
 
@@ -10,6 +10,6 @@ gem "pry", "~> 0.13"
10
10
  gem "pry-byebug", "~> 3.9"
11
11
  gem "rake", "~> 10.0"
12
12
  gem "rspec", "~> 3.0"
13
- gem "rails", "~> 6.0"
13
+ gem "rails", "~> 6.0.0"
14
14
 
15
15
  gemspec path: "../"
@@ -49,6 +49,18 @@ module FiberedMysql2
49
49
  raise ::ActiveRecord::ActiveRecordError, "Cannot expire connection, it is not currently leased."
50
50
  end
51
51
  end
52
+
53
+ def steal!
54
+ if in_use?
55
+ if @owner != Fiber.current
56
+ pool.send :remove_connection_from_thread_cache, self, @owner
57
+
58
+ @owner = Fiber.current
59
+ end
60
+ else
61
+ raise ::ActiveRecord::ActiveRecordError, "Cannot steal connection, it is not currently leased."
62
+ end
63
+ end
52
64
  end
53
65
 
54
66
  class FiberedMysql2Adapter < ::ActiveRecord::ConnectionAdapters::EMMysql2Adapter
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FiberedMysql2
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fibered_mysql2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Invoca Development
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-23 00:00:00.000000000 Z
11
+ date: 2021-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: em-synchrony