1. 26 1月, 2016 1 次提交
  2. 24 1月, 2016 3 次提交
  3. 23 1月, 2016 1 次提交
  4. 22 1月, 2016 3 次提交
  5. 19 1月, 2016 5 次提交
  6. 16 1月, 2016 2 次提交
    • T
      Avoid multiple default paths to server.pid file · 221b4aea
      Tawan Sierek 提交于
      Fix bug (#22811) that occurs when rails server is started in daemon mode
      and optional path to the `server.pid` file is omitted. Store default path
      in a constant instead of evaluating it multiple time using `File.expand_path`.
      
      The bug in detail: The server startup procedure crashes, since it tries to
      open a file at `/tmp/pids/server.pid` instead of
      `<path to project>/tmp/pids/server.pid`. This bug was introduced in 51211a94
      when Rack was upgraded from version 1.x to 2.x. Since version 2.x,
      Rack does not memoize the options hash [1], and as a consequence
      `Rails::Server#default_options` will be evaluated multiple times.
      The hash returned by `Rails::Server#default_options` holds the default path
      to the `server.pid` file. The path is generated with the method
      `File.expand_path`. However, the return value of this method depends on the
      current working directory [2], which changes once `Process.daemon` is invoked
      by `Rack::Server#daemonize_app` and the process is detached from the current
      shell.
      
      Close #22811
      
      [1]https://git.io/vzen2
      [2]http://ruby-doc.org/core-2.1.5/File.html#method-c-expand_path
      221b4aea
    • Y
      allow symbol to end of string in `wrap_in_modules` · 26b5cbf4
      yuuji.yaginuma 提交于
      26b5cbf4
  7. 15 1月, 2016 1 次提交
  8. 13 1月, 2016 1 次提交
  9. 11 1月, 2016 2 次提交
  10. 09 1月, 2016 2 次提交
    • P
      rake log:clear task updated refs[#22544] · 68f46a81
      Pramod 提交于
      - Avoided truncating all files if no ENV['LOGS'] specified
      - Updated task to accept LOGS=all for truncating all files from log/ i.e. log/*log
      - If no LOGS specified will truncates standard environment log files i.e. 'development,test,production'
      - CHANGELOG & guide update added
      - bin/setup test cases fixed
      68f46a81
    • S
      Fixing tests and re-locating error checking. · d70c68d7
      schneems 提交于
      d70c68d7
  11. 08 1月, 2016 1 次提交
    • S
      Prevent destructive action on production database · 900bfd94
      schneems 提交于
      This PR introduces a key/value type store to Active Record that can be used for storing internal values. It is an alternative implementation to #21237 cc @sgrif @matthewd.
      
      It is possible to run your tests against your production database by accident right now. While infrequently, but as an anecdotal data point, Heroku receives a non-trivial number of requests for a database restore due to this happening. In these cases the loss can be large.
      
      To prevent against running tests against production we can store the "environment" version that was used when migrating the database in a new internal table. Before executing tests we can see if the database is a listed in `protected_environments` and abort. There is a manual escape valve to force this check from happening with environment variable `DISABLE_DATABASE_ENVIRONMENT_CHECK=1`.
      900bfd94
  12. 07 1月, 2016 1 次提交
    • S
      Default new apps to tag logs with `request_id` · 81d3bec4
      schneems 提交于
      In high volume applications it can be very difficult to figure out what is happening in logs because each request is not easily identified. For example 3 requests could look something like this:
      
      ```
      Started GET "/" for 72.48.77.213 at 2016-01-06 20:30:21 +0000
        Rendered welcome/index.html.erb within layouts/application (0.1ms)
      Started GET "/" for 72.48.77.213 at 2016-01-06 20:30:22 +0000
      Started GET "/" for 72.48.77.213 at 2016-01-06 20:30:23 +0000
        Rendered welcome/index.html.erb within layouts/application (0.1ms)
      Processing by WelcomeController#index as HTML
      Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.0ms)
      Processing by WelcomeController#index as HTML
        Rendered welcome/index.html.erb within layouts/application (0.1ms)
      Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.0ms)
        Processing by WelcomeController#index as HTML
      Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.0ms)
      ```
      
      The `:request_id` log tag ensures that each request is tagged with a unique identifier. While they are still interleaved it is possible to figure out which lines belong to which requests. Like:
      
      ```
      [c6034478-4026-4ded-9e3c-088c76d056f1] Started GET "/" for 72.48.77.213 at 2016-01-06 20:30:21 +0000
      [c6034478-4026-4ded-9e3c-088c76d056f1]  Rendered welcome/index.html.erb within layouts/application (0.1ms)
      [abuqw781-5026-6ded-7e2v-788c7md0L6fQ] Started GET "/" for 72.48.77.213 at 2016-01-06 20:30:22 +0000
      [acfab2a7-f1b7-4e15-8bf6-cdaa008d102c] Started GET "/" for 72.48.77.213 at 2016-01-06 20:30:23 +0000
      [abuqw781-5026-6ded-7e2v-788c7md0L6fQ]  Rendered welcome/index.html.erb within layouts/application (0.1ms)
      [c6034478-4026-4ded-9e3c-088c76d056f1] Processing by WelcomeController#index as HTML
      [c6034478-4026-4ded-9e3c-088c76d056f1] Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.0ms)
      [abuqw781-5026-6ded-7e2v-788c7md0L6fQ] Processing by WelcomeController#index as HTML
      [abuqw781-5026-6ded-7e2v-788c7md0L6fQ]  Rendered welcome/index.html.erb within layouts/application (0.1ms)
      [abuqw781-5026-6ded-7e2v-788c7md0L6fQ] Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.0ms)
      [acfab2a7-f1b7-4e15-8bf6-cdaa008d102c]  Processing by WelcomeController#index as HTML
      [acfab2a7-f1b7-4e15-8bf6-cdaa008d102c] Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.0ms)
      ```
      
      Now if you have the logs and you find this unique ID you can filter to only look at information from that request. So a filtered log output would be very clear:
      
      ```
      [c6034478-4026-4ded-9e3c-088c76d056f1] Started GET "/" for 72.48.77.213 at 2016-01-06 20:30:21 +0000
      [c6034478-4026-4ded-9e3c-088c76d056f1]  Rendered welcome/index.html.erb within layouts/application (0.1ms)
      [c6034478-4026-4ded-9e3c-088c76d056f1] Processing by WelcomeController#index as HTML
      [c6034478-4026-4ded-9e3c-088c76d056f1] Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.0ms)
      ```
      
      In addition to this benefit the `:request_id` can be set via the `X-Request-ID` header so that the same request could be traced between multiple components. For example a request comes in Nginx (or another load balancer) could assign a request id. As the load balancer processes the request I can log using that id, then when the request is passed on to Rails, the same id is used. That way if a problem is determined to be not caused in Rails it could be traced back to other components with the same ID. You can set a value in nginx for example using something like this:
      
      ```
        location / {
            proxy_pass http://upstream;
            proxy_set_header X-Request-Id $pid-$msec-$remote_addr-$request_length;
        }
      # http://stackoverflow.com/questions/17748735/setting-a-trace-id-in-nginx-load-balancer
      ```
      
      Heroku sets this header value so problems like timeouts that are logged by like router can be traced back to specific request within the application.
      
      Whether you are using components that are setting request ID or not, all production applications can benefit from the additional debugging information of having a unique identifier for all requests. This change will only affect new applications, anyone can opt out by commenting or removing the line in `config/production.rb`.
      81d3bec4
  13. 06 1月, 2016 2 次提交
  14. 05 1月, 2016 1 次提交
  15. 02 1月, 2016 2 次提交
  16. 31 12月, 2015 1 次提交
  17. 29 12月, 2015 1 次提交
  18. 22 12月, 2015 5 次提交
  19. 21 12月, 2015 2 次提交
  20. 19 12月, 2015 1 次提交
  21. 18 12月, 2015 2 次提交
    • R
      Do not check the version anymore · 840b3dd9
      Rafael Mendonça França 提交于
      Our logic is complex now and we don't need to check the version to asset
      the behavior so I'm removing the checking here.
      840b3dd9
    • M
      Allow normal version updates within a release series · 46d1cc90
      Matthew Draper 提交于
      We originally chose to apply very strict versioning on the `rails` entry
      in the Gemfile, because our future versioning policy was not strongly
      defined.
      
      Now it is, and our policy is very much designed on the expectation that
      people will regularly update to the latest patch level in their release
      series... so we should encourage that.
      
      Of course, Gemfile.lock will do its job and prevent unplanned updates,
      just as it does for every other gem in the bundle... but if you run
      `bundle update`, we want to get you the latest bug/security fixes
      without requiring a manual edit of the Gemfile entry.
      
      Our current version could be a few different shapes, so it takes a bit
      of work to find the right specifier, but in principle, we match anything
      of the form x.y.*, where x.y matches our current release series.
      46d1cc90