aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix corrupt transaction state caused by `before_commit` exceptionsJeremy Daer2016-02-012-2/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | When a `before_commit` callback raises, the database is rolled back but AR's record of the current transaction is not, leaving the connection in a perpetually broken state that affects all future users of the connection: subsequent requests, jobs, etc. They'll think a transaction is active when none is, so they won't BEGIN on their own. This manifests as missing `after_commit` callbacks and broken ROLLBACKs. This happens because `before_commit` callbacks fire before the current transaction is popped from the stack, but the exception-handling path they hit assumes that the current transaction was already popped. So the database ROLLBACK is issued, but the transaction stack is left intact. Common cause: deadlocked `#touch`, which is now implemented with `before_commit` callbacks. What's next: * We shouldn't allow active transaction state when checking in or out from the connection pool. Verify that conns are clean. * Closer review of txn manager sad paths. Are we missing other spots where we'd end up with incorrect txn state? What's the worst that can happen if txn state drifts? How can we guarantee it doesn't and contain the fallout if it does? Thanks for @tomafro for expert diagnosis!
* Merge pull request #23025 from ↵Sean Griffin2016-02-016-14/+42
|\ | | | | | | | | yahonda/shorten_internal_metadata_table_name_less_than_30_byte Shorten ActiveRecord::InternalMetadata.table_name to ar_internal_metadata
| * Rename `active_record_internal_metadatas` to `ar_internal_metadata`Yasuo Honda2016-02-012-0/+28
| | | | | | | | for those who already migrated to Rails 5.0.0 beta
| * Shorten ActiveRecord::InternalMetadata.table_name to ar_internal_metadataYasuo Honda2016-02-015-14/+14
| | | | | | | | to support Oracle database which only supports 30 byte identifier length
* | Merge pull request #23401 from claudiob/fix-as-changelog-mdClaudio B2016-02-011-29/+29
|\ \ | | | | | | [ci skip] Properly indent code in markdown
| * | [ci skip] Properly indent code in markdownclaudiob2016-02-011-29/+29
|/ / | | | | | | [ci skip]
* | Merge pull request #23057 from schneems/schneems/default-puma-configRichard Schneeman2016-02-015-3/+64
|\ \ | | | | | | Add Default Puma Config
| * | Add Default Puma Configschneems2016-01-295-3/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the `puma` command is run without any configuration options it will detect presence of a `config/puma.rb` file and use that. Currently there is discrepancy between `puma` command and `rails server` but Evan said it would be reasonable to add in reading in config from the default location. I am working on that right now as a feature in puma/puma. Why do we need this? By default Puma uses 16 threads, and by default ActiveRecord only has 5 threads. Due to the architecture of AR it is guaranteed that if you're running with fewer DB connections than your server has threads you will hit `ActiveRecord::ConnectionTimeoutError ` eventually if your app gets modest amounts of traffic. Since we are providing a default webserver, we should provide reasonable configuration for that webserver. This PR does a few things, first it sets the default Puma thread count to 5 to mach ActiveRecord's default. It sets the default environment to `"development"` and the default port to 300 so that booting the server with `$ puma` will give you the same default port as `rails server`. It is worth mentioning that by reading in from `PORT` environment variable this config can work with containerized deployments, such as on Heroku. We are not using worker processes by default, that way JRuby and windows devs can use this configuration without modification. I went ahead and included a default `on_worker_boot`. It won't be used unless a worker count is specified, that means this config will not use it. Even though it's not being used now It will make someone who wants to try modifying their config to run extra workers easier. cc/ @pixeltrix
* | | Merge pull request #23385 from matthewd/default-subscription-adapterMatthew Draper2016-02-021-4/+2
|\ \ \ | | | | | | | | Change default ACa adapter for development & test
| * | | Use the in-process subscription adapter for development & testMatthew Draper2016-02-011-4/+2
| | | |
* | | | Merge pull request #23381 from matthewd/uneventful-redisMatthew Draper2016-02-028-35/+212
|\ \ \ \ | |_|_|/ |/| | | Redis sans EventMachine
| * | | Switch the default redis adapter to a single-stream modelMatthew Draper2016-02-018-35/+212
| | | | | | | | | | | | | | | | | | | | | | | | This new adapter does get a little more intimate with the redis-rb gem's implementation than I would like, but it's the least bad of the approaches I've come up with.
* | | | Merge pull request #23375 from prathamesh-sonpatki/fix-19835Rafael França2016-02-012-13/+6
|\ \ \ \ | | | | | | | | | | Fix documentation related to `config.assets.cache_store` [ci skip]
| * | | | Fix documentation related to `config.assets.cache_store` [ci skip]Prathamesh Sonpatki2016-02-012-13/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - sprockets-rails no longer supports customizing cache store after rails/sprockets-rails@ecaeb27 using `config.assets.cache_store`. - Instead we need to configure it using block syntax. - Fixes #19835.
* | | | | tabenai (typo)Akira Matsuda2016-02-011-6/+6
| | | | |
* | | | | Merge pull request #23391 from erullmann/join_table_indexesRafael França2016-02-011-0/+4
|\ \ \ \ \ | | | | | | | | | | | | Added references option to join tables
| * | | | | Added references option to join tablesErnst Rullmann2016-01-311-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes issue #22960 When creating join tables with the command rails g migration CreateJoinTableShowroomUser showroom:references user:references The migration will use references to create the joins and output: class CreateJoinTableShowroomUser < ActiveRecord::Migration def change create_join_table :showrooms, :users do |t| t.references :showroom, index: true, foreign_key: true t.references :user, index: true, foreign_key: true end end end This allows for proper refrences with indexes and foreign keys to be easily used when adding join tables. Without `:refrences` the normal output is generated: class CreateJoinTableShowroomUser < ActiveRecord::Migration[5.0] def change create_join_table :showrooms, :users do |t| # t.index [:showroom_id, :user_id] # t.index [:user_id, :showroom_id] end end end
* | | | | | Merge pull request #23168 from kamipo/avoid_extra_show_variables_in_migrationRafael França2016-02-015-21/+15
|\ \ \ \ \ \ | |/ / / / / |/| | | | | Avoid extra `show variables` in migration
| * | | | | Avoid extra `show variables` in migrationRyuta Kamizono2016-02-015-21/+15
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `initialize_schema_migrations_table` is called in every migrations. https://github.com/rails/rails/blob/v5.0.0.beta1/activerecord/lib/active_record/migration.rb#L1080 https://github.com/rails/rails/blob/v5.0.0.beta1/activerecord/lib/active_record/schema.rb#L51 This means that extra `show variables` is called regardless of the existence of `schema_migrations` table. This change is to avoid extra `show variables` if `schema_migrations` table exists.
* | | | | Merge pull request #23359 from kamipo/make_to_primary_keyRafael França2016-02-014-40/+5
|\ \ \ \ \ | | | | | | | | | | | | Make to primary key instead of an unique index for internal tables
| * | | | | Make to primary key instead of an unique index for internal tablesRyuta Kamizono2016-01-314-40/+5
| | | | | |
* | | | | | Remove development dependencies from actioncable.gemspecMatthew Draper2016-02-011-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | None of the other components use them, so we should be consistent.
* | | | | | Merge pull request #23373 from ↵Rafael França2016-02-013-17/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | kamipo/remove_duplicated_composite_primary_key_tests Remove duplicated composite primary key tests
| * | | | | | Remove duplicated composite primary key testsRyuta Kamizono2016-02-013-17/+1
| | | | | | |
* | | | | | | Merge pull request #23389 from kamipo/extract_explain_pretty_printerRafael França2016-02-017-119/+137
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Extract `ExplainPrettyPrinter` to appropriate files
| * | | | | | | Extract `ExplainPrettyPrinter` to appropriate filesRyuta Kamizono2016-02-017-119/+137
| |/ / / / / /
* / / / / / / Revert "Merge pull request #23366 from maclover7/add-configuation-ar-docs"Rafael Mendonça França2016-02-011-102/+0
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 96355e87cba247246234386b0af9273cc5d59db9, reversing changes made to a00c36feea6c0271b5ad48a949ef294514fdef52. See https://github.com/rails/rails/pull/23366#issuecomment-177714429
* | | | | | Merge pull request #23372 from kamipo/use_index_in_create_in_test_schemaRafael França2016-02-012-11/+9
|\ \ \ \ \ \ | | | | | | | | | | | | | | Use `t.index` in `create_table` instead of `add_index` in test schema
| * | | | | | Use `t.index` in `create_table` instead of `add_index` in test schemaRyuta Kamizono2016-01-312-11/+9
| | |/ / / / | |/| | | | | | | | | | | | | | | | For reduce bootstrap queries in tests.
* | | | | | Merge pull request #23374 from prathamesh-sonpatki/migration-compatiblity-testsRafael França2016-01-311-0/+30
|\ \ \ \ \ \ | | | | | | | | | | | | | | Added test for backward compatibility of null constraints on timestamp columns
| * | | | | | Added test for backward compatibility of null constraints on timestamp columnsPrathamesh Sonpatki2016-01-311-0/+30
| |/ / / / /
* | | | | | :speak_no_evil: :warning:Akira Matsuda2016-02-012-2/+6
| | | | | |
* | | | | | Merge pull request #23360 from kamipo/oid_money_precision_is_unusedRafael França2016-01-312-8/+0
|\ \ \ \ \ \ | | | | | | | | | | | | | | `OID::Money.precision` is unused since #15239
| * | | | | | `OID::Money.precision` is unused since #15239Ryuta Kamizono2016-01-312-8/+0
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | p PostgreSQLAdapter::OID::Money.precision # => 19 p PostgreSQLAdapter::OID::Money.new.precision # => nil
* | | | | | Merge pull request #23388 from prathamesh-sonpatki/update-gemfile-lockRafael França2016-01-311-1/+0
|\ \ \ \ \ \ | | | | | | | | | | | | | | Update Gemfile.lock
| * | | | | | Update Gemfile.lockPrathamesh Sonpatki2016-02-011-1/+0
|/ / / / / / | | | | | | | | | | | | | | | | | | - Leftover from https://github.com/rails/rails/commit/93abf58787396661230f31c7a2f58c18f30dbec9.
* | | | | | Merge pull request #23380 from ↵Arthur Nogueira Neves2016-01-311-8/+13
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | yui-knk/override_calculate_constructables_at_each_concrete_class Remove `case macro` from `calculate_constructable`
| * | | | | | Remove `case macro` from `calculate_constructable`yui-knk2016-02-011-8/+13
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rails has abstract Reflection classes (`MacroReflection`, `AssociationReflection` etc.) and concrete Reflection classes (e.g. `HasManyReflection`, `HasOneReflection` etc.). In many case `calculate_constructable` returns `true`, so change `calculate_constructable` to always return `true` and override this method if necessary.
* | | | | | Merge pull request #23387 from mcfiredrill/clarify-touching-callbacksKasper Timm Hansen2016-01-311-0/+2
|\ \ \ \ \ \ | | | | | | | | | | | | | | clarify the touch true option does not trigger after_save/update [ci skip]
| * | | | | | clarify the touch true option does not trigger after_save/update [ci skip]Tony Miller2016-02-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've gotten tripped up more than a few times on this, thinking that using `belongs_to` with `touch: true` would trigger my after_save or after_update callbacks. The same text is in the documentation for the touch method itself, but I think its helpful to repeat it again here. It might save people some time.
* | | | | | | Merge pull request #23370 from maclover7/actioncable-main-travis-buildGuillermo Iguaran2016-01-312-10/+0
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Move Action Cable back to the main build
| * | | | | | | Remove unused methodJon Moss2016-01-311-9/+0
| | | | | | | |
| * | | | | | | Move Action Cable back to the main buildJon Moss2016-01-301-1/+0
| | |_|/ / / / | |/| | | | |
* | | | | | | Merge pull request #22857 from bdewater/interlock-docVipul A M2016-02-014-8/+9
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Update middleware docs regarding ActionDispatch::LoadInterlock [ci skip]
| * | | | | | | Update middleware docs regarding ActionDispatch::LoadInterlock [ci skip]Bart de Water2016-01-314-9/+10
| | | | | | | |
* | | | | | | | Merge pull request #23169 from y-yagi/rake_proxy_in_engineKasper Timm Hansen2016-01-316-40/+127
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | make rake proxy work in rails engines
| * | | | | | | | make rake proxy work in rails enginesyuuji.yaginuma2016-01-316-40/+127
| | | | | | | | |
* | | | | | | | | Merge pull request #23379 from ↵Kasper Timm Hansen2016-01-311-22/+25
|\ \ \ \ \ \ \ \ \ | |_|_|_|_|_|_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | yui-knk/define_association_class_on_each_concrete_class Each concrete classes have responsibility to return `association_class`
| * | | | | | | | Each concrete classes have responsibility to return `association_class`yui-knk2016-01-311-22/+25
| | | | | | | | |
* | | | | | | | | Drop the runtime dependency on coffee-railsMatthew Draper2016-02-011-1/+0
| | | | | | | | |