aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Simplify serializable test to avoid mystery deadlockMatthew Draper2016-10-071-23/+21
| | |
* | | Merge pull request #26714 from matthewd/close-raceMatthew Draper2016-10-076-15/+22
|\ \ \ | | | | | | | | Work around read/close race (x2)
| * | | Wait for the socket to be closed asynchronouslyMatthew Draper2016-10-061-2/+10
| | | |
| * | | Use a branch of websocket-client-simple, to work around read/close raceMatthew Draper2016-10-063-12/+11
| | | |
| * | | Close the IO from the read loop threadMatthew Draper2016-10-062-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IO#close and IO#read across threads don't get along so well: After T1 enters #read and releases the GVL, T2 can call #close on the IO, thereby both closing the fd and freeing the buffer while T1 is using them.
* | | | Merge pull request #24963 from fertapric/recover-db-runtime-on-production-logsEileen M. Uchitelle2016-10-061-2/+1
|\ \ \ \ | | | | | | | | | | Fix database runtimes on production log
| * | | | Fix DB runtimes on production logFernando Tapia Rico2016-05-111-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rails default production configuration establishes "info" as log level. Due to the changes included on commit 191facc857bb4fb52078fb544c6bc1613a81cc80, db runtimes were not being collected if the log level was different than "debug", and 0.0 ms was the runtime reported on production logs.
* | | | | Merge pull request #26631 from kamipo/remove_duplicate_conditionMatthew Draper2016-10-061-3/+1
|\ \ \ \ \ | | | | | | | | | | | | Remove duplicated `unless current_adapter?(:SQLite3Adapter)` condition
| * | | | | Remove duplicated `unless current_adapter?(:SQLite3Adapter)` conditionRyuta Kamizono2016-09-271-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `test_native_decimal_insert_manual_vs_automatic` exists inside `unless current_adapter?(:SQLite3Adapter)`. This condition is duplicated.
* | | | | | Merge pull request #26633 from kamipo/text_too_big_should_be_textMatthew Draper2016-10-061-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | `:text_too_big` column should be `:text`, not `:integer`
| * | | | | | `:text_too_big` column should be `:text`, not `:integer`Ryuta Kamizono2016-09-271-1/+1
| |/ / / / /
* | | | | | Merge pull request #25304 from kbrock/calculate_attributesMatthew Draper2016-10-061-6/+2
|\ \ \ \ \ \ | | | | | | | | | | | | | | Use attribute_names over column_names
| * | | | | | Use attribute_names over column_namesKeenan Brock2016-10-041-6/+2
| | |_|_|/ / | |/| | | |
* | | | | | Merge pull request #26359 from maclover7/jm-speed-up-timeMatthew Draper2016-10-061-0/+2
|\ \ \ \ \ \ | | | | | | | | | | | | | | Speed up Time.zone.now
| * | | | | | Speed up Time.zone.nowJon Moss2016-10-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | @amatsuda, during his RailsConf talk this past year, presented a benchmark that showed `Time.zone.now` (an Active Support joint) performing 24.97x slower than Ruby's `Time.now`. Rails master appears to be a _bit_ faster than that, currently clocking in at 18.25x slower than `Time.now`. Here's the exact benchmark data for that: ``` Warming up -------------------------------------- Time.now 127.923k i/100ms Time.zone.now 10.275k i/100ms Calculating ------------------------------------- Time.now 1.946M (± 5.9%) i/s - 9.722M in 5.010236s Time.zone.now 106.625k (± 4.3%) i/s - 534.300k in 5.020343s Comparison: Time.now: 1946220.1 i/s Time.zone.now: 106625.5 i/s - 18.25x slower ``` What if I told you we could make `Time.zone.now` _even_ faster? Well, that's exactly what this patch accomplishes. When creating `ActiveSupport::TimeWithZone` objects, we try to convert the provided time to be in a UTC format. All this patch does is, in the method where we convert a provided time to UTC, check if the provided time is already UTC, and is a `Time` object and then return early if that is the case, This sidesteps having to continue on, and create a new `Time` object from scratch. Here's the exact benchmark data for my patch: ``` Warming up -------------------------------------- Time.now 124.136k i/100ms Time.zone.now 26.260k i/100ms Calculating ------------------------------------- Time.now 1.894M (± 6.4%) i/s - 9.434M in 5.000153s Time.zone.now 301.654k (± 4.3%) i/s - 1.523M in 5.058328s Comparison: Time.now: 1893958.0 i/s Time.zone.now: 301653.7 i/s - 6.28x slower ``` With this patch, we go from `Time.zone.now` being 18.25x slower than `Time.now` to only being 6.28x slower than `Time.now`. I'd obviously love some verification on this patch, since these numbers sound pretty interesting... :) This is the benchmark-ips report I have been using while working on this: ```ruby require 'benchmark/ips' Time.zone = 'Eastern Time (US & Canada)' Benchmark.ips do |x| x.report('Time.now') { Time.now } x.report('Time.zone.now') { Time.zone.now } x.compare! end ``` cc @amatsuda cc performance folks @tenderlove and @schneems ![Pretty... pretty... pretty good.](https://media.giphy.com/media/bWeR8tA1QV4cM/giphy.gif)
* | | | | | | Merge pull request #26710 from kenta-s/change-page-change-to-turbolinks-loadJon Moss2016-10-052-2/+2
|\ \ \ \ \ \ \ | |_|_|_|_|/ / |/| | | | | | Change page:change to turbolinks:load in README.md [ci skip]
| * | | | | | Change page:change to turbolinks:load in README.md [ci skip]kenta-s2016-10-052-2/+2
|/ / / / / /
* | | | | | Merge pull request #24571 from raimo/patch-1Sean Griffin2016-10-043-1/+24
|\ \ \ \ \ \ | | | | | | | | | | | | | | Print the proper ::Float::INFINITY value when used as a default value
| * | | | | | Print the proper ::Float::INFINITY value when used as a default valueRaimo Tuisku2016-05-233-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Addresses https://github.com/rails/rails/issues/22396
* | | | | | | Merge pull request #26684 from matthewd/executor-serialMatthew Draper2016-10-055-19/+87
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Avoid bumping the class serial when invoking executor
| * | | | | | | Avoid bumping the class serial when invoking executorMatthew Draper2016-10-035-19/+87
| | | | | | | |
* | | | | | | | Merge pull request #26686 from matthewd/deprecation-callerMatthew Draper2016-10-051-0/+13
|\ \ \ \ \ \ \ \ | |_|_|_|/ / / / |/| | | | | | | Correct caller tracking in delegated deprecation methods
| * | | | | | | Correct caller tracking in delegated deprecation methodsMatthew Draper2016-10-031-0/+13
| |/ / / / / /
* | | | | | | Merge pull request #26693 from ↵Andrew White2016-10-048-9/+23
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | iainbeeston/consistently-use-activerecord-attributes Made ActiveRecord consistently use ActiveRecord::Type (not ActiveModel::Type)
| * | | | | | | Made ActiveRecord consistently use ActiveRecord::Type (notIain Beeston2016-10-038-9/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ActiveModel::Type) Some code was previously referring to ActiveModel::Type::*. This could cause issues in the future if any of the ActiveRecord::Type classes were overridden in the future.
* | | | | | | | Merge pull request #26701 from kamipo/restore_gemfile_lock_entriesAndrew White2016-10-041-0/+2
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Restore missing Gemfile.lock entries
| * | | | | | | | Restore missing Gemfile.lock entriesRyuta Kamizono2016-10-041-0/+2
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | These lines were lost in https://github.com/rails/rails/pull/26695/files#diff-e79a60dc6b85309ae70a6ea8261eaf95L192.
* | | | | | | | Merge pull request #26699 from Neodelf/request_idJon Moss2016-10-031-3/+4
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | [ci-skip] Swap method and its alias, format doc
| * | | | | | | | [ci-skip] Swap method and its alias, format docAndrey Molchanov2016-10-041-3/+4
| | | | | | | | |
* | | | | | | | | Don't shut down adapters that haven't been setMatthew Draper2016-10-041-1/+1
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | We hit when we skip the PostgreSQL adapter.
* | | | | | | | Merge pull request #26695 from MentalPower/masterEileen M. Uchitelle2016-10-035-22/+27
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Allow the use of listen's 3.1.x branch.
| * | | | | | | | Allow the use of listen's 3.1.x branch.Esteban Santana Santana2016-10-035-22/+27
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the initial evented monitor feature was written, the latest version of listen was the 3.0.x series. Since then the listen project has moved on to the 3.1.x series. This patch allows the use of the new versions.
* | | | | | | | Merge pull request #26555 from ↵Andrew White2016-10-035-9/+23
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | chriscarter90/unmatched-constraint-routing-messages Show an "unmatched constraints" error when params fail to match constraints
| * | | | | | | Show an "unmatched constraints" error for mismatching and present paramsChris Carter2016-10-035-9/+23
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently a misleading "missing required keys" error is thrown when a param fails to match the constraints of a particular route. This commit ensures that these params are recognised as unmatching rather than missing. Note: this means that a different error message will be provided between optimized and non-optimized path helpers, due to the fact that the former does not check constraints when matching routes. Fixes #26470.
* | | | | | | Temporarily make ACa tests noiser and more predictableMatthew Draper2016-10-031-1/+1
| | | | | | |
* | | | | | | Merge pull request #26425 from prathamesh-sonpatki/fix-nil-issueMatthew Draper2016-10-032-10/+19
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Fix issue with `cache_key` when the named timestamp column has value nil
| * | | | | | | Fix issue with `cache_key` when the named timestamp column has value nilPrathamesh Sonpatki2016-09-072-10/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - When the named timestamp column is nil, we should just return the cache_key with model name and id similar to the behavior of implicit timestamp columns. - Fixed one of the issue mentioned in https://github.com/rails/rails/issues/26417.
* | | | | | | | Shut down the worker pool - don't kill itMatthew Draper2016-10-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Different parts of concurrent-ruby's documentation make inconsistent claims about how kill will behave. It doesn't do the thing we want.
* | | | | | | | Merge pull request #26620 from maclover7/jm-ac-pg-bugMatthew Draper2016-10-032-2/+39
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Shutdown pubsub connection before classes are reloaded
| * | | | | | | | Add tests for Server::Base#restartJon Moss2016-10-021-0/+33
| | | | | | | | |
| * | | | | | | | Move behavior to Server::Base, and flush pubsubJon Moss2016-10-022-3/+6
| | | | | | | | |
| * | | | | | | | Shutdown pubsub connection before classes are reloadedJon Moss2016-10-021-0/+1
| | |_|_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this patch, if you were to make a file edit in your Rails application and you tried to load up the page, it would hang indefinitely. The issue is that Active Record is trying to cleanup after itself and clear all active connection, but Action Cable is still holding onto a connection from the pool. To resolve this, we are now shutting down the pubsub adapter before classes are reloaded, to avoid this altogether (connection is being returned to the pool). Credits to @skateman for discovering this bug. :)
* | | | | | | | Cache to_time to improve performance when comparingAndrew White2016-10-021-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In #25880 we tried to cache localtime to fix the performance regression but that proved to be difficult due to the fact that localtime/getlocal can take a utc_offset argument. We tried caching based on the argument but since the argument can be nil sometimes that meant that if the TZ environment variable changed then the cached value for nil became invalid. By moving the caching to DateAndTime#compatibility we don't have to worry about arguments since it doesn't take any. There is a possible edge condition where preserve_timezone is set to false and the system timezone changes then it could result in a cached value being incorrect but the only way to fix this would be to remove all caching and live with the performance issue.
* | | | | | | | Revert "Merge pull request #25880 from ↵Andrew White2016-10-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ryandv/fix_performance_regression_in_timewithzone_to_time" Turns out trying to cache on localtime with arguments is too hard so we'll do it on DateAndTime::Compatibility#to_time instead. This reverts commit 3132fa6b7d9585e04eb44b25b55d298391b040b5, reversing changes made to 6949f8e5e7dc901d4e04ebab6c975afb33ca44c9.
* | | | | | | | Revert "Merge pull request #26677 from tbalthazar/26644"Andrew White2016-10-023-30/+1
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Turns out trying to cache on localtime with arguments is too hard so we'll do it on DateAndTime::Compatibility#to_time instead. This reverts commit 9ce2d1b1a43fc4ef3db59849b7412d30583a4074, reversing changes made to 53ede1aff2025d4391d0e05ba471fdaf3110a99c.
* | | | | | | Merge pull request #26683 from y-yagi/add_cached_key_to_sql_active_record_eventJon Moss2016-10-021-6/+7
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | add `cached` key to `sql.active_record` event [ci skip]
| * | | | | | add `cached` key to `sql.active_record` event [ci skip]yuuji.yaginuma2016-10-021-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow up to #26584
* | | | | | | Merge pull request #26672 from schpet/support_ruby_keywords_as_template_localsMatthew Draper2016-10-026-1/+47
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Avoid compiling ruby keywords into template locals
| * | | | | | | Change render to support any hash keys in localsPeter Schilling2016-10-026-1/+47
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this lets you pass ruby keywords to templates: <%= render 'example', class: "cool" %> <%= render 'example', "spaces are" => "a-ok" %> <%= render 'example', Foo: "bar" %> Previously you'd see confusing syntax errors like this: SyntaxError (.../_example.html.erb:1: syntax error, unexpected '=' Now you can reference invalid identifiers through local_assigns. If you try to use an invalid keyword (e.g. class) in your template, you get a syntax error on the line where you use it.
* | | | | | | Merge pull request #26682 from matthewd/cable-testsMatthew Draper2016-10-025-63/+96
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Use websocket-client-simple instead of Faye in tests