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 +4 -4
- data/Appraisals +1 -1
- data/CHANGELOG.md +9 -0
- data/Gemfile.lock +1 -1
- data/gemfiles/rails_6.gemfile +1 -1
- data/lib/active_record/connection_adapters/fibered_mysql2_adapter.rb +12 -0
- data/lib/fibered_mysql2/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48308ffbe571baaa919c2f198d761657f9f77b95a87f67c3ef7493433a3e4a6a
|
4
|
+
data.tar.gz: c5893a679a730bfd7e1a088a06f86b82d65c95da9b9171fcb419f27298ca268c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af9979eb4a038db1fcbec58dc5a88d617a71271c1588ff0717a4792f5442b3c59d82e9bc8d76b59821179099c87c8387a72bbbcdb096d10991320e7001c4bda8
|
7
|
+
data.tar.gz: 05a912e4b5504aebfb6a0ad5e8a29e72cb8e739066279982ead7aa89ca97b9308f2144ed6142833cba84ad7939c8ee0d364e71065606221ebe52cf4ee35ce0e1
|
data/Appraisals
CHANGED
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
data/gemfiles/rails_6.gemfile
CHANGED
@@ -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
|
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.
|
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:
|
11
|
+
date: 2021-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: em-synchrony
|