Hello community, here is the log from the commit of package rubygem-puma for openSUSE:Factory checked in at 2015-08-27 08:56:13 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-puma (Old) and /work/SRC/openSUSE:Factory/.rubygem-puma.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-puma" Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-puma/rubygem-puma.changes 2015-08-05 19:14:42.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-puma.new/rubygem-puma.changes 2015-08-27 08:56:15.000000000 +0200 @@ -1,0 +2,25 @@ +Sat Aug 15 04:32:20 UTC 2015 - co...@suse.com + +- updated to version 2.13.0 + see installed History.txt + + === 2.13.0 / 2015-08-14 + + * 1 minor feature: + * Add before_fork hooks option. + + * 3 bug fixes: + * Check for OPENSSL_NO_ECDH before using ECDH + * Eliminate logging overhead from JRuby SSL + * Prefer cli options over config file ones. Fixes #669 + + * 1 deprecation: + * Add deprecation warning to capistrano.rb. Fixes #673 + + * 4 PRs merged: + * Merge pull request #668 from kcollignon/patch-1 + * Merge pull request #754 from nathansamson/before_boot + * Merge pull request #759 from BenV/fix-centos6-build + * Merge pull request #761 from looker/no-log + +------------------------------------------------------------------- Old: ---- puma-2.12.3.gem New: ---- puma-2.13.0.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-puma.spec ++++++ --- /var/tmp/diff_new_pack.d6XKTJ/_old 2015-08-27 08:56:15.000000000 +0200 +++ /var/tmp/diff_new_pack.d6XKTJ/_new 2015-08-27 08:56:15.000000000 +0200 @@ -24,7 +24,7 @@ # Name: rubygem-puma -Version: 2.12.3 +Version: 2.13.0 Release: 0 %define mod_name puma %define mod_full_name %{mod_name}-%{version} ++++++ puma-2.12.3.gem -> puma-2.13.0.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/History.txt new/History.txt --- old/History.txt 2015-08-04 07:18:55.000000000 +0200 +++ new/History.txt 2015-08-15 03:34:19.000000000 +0200 @@ -1,3 +1,22 @@ +=== 2.13.0 / 2015-08-14 + +* 1 minor feature: + * Add before_fork hooks option. + +* 3 bug fixes: + * Check for OPENSSL_NO_ECDH before using ECDH + * Eliminate logging overhead from JRuby SSL + * Prefer cli options over config file ones. Fixes #669 + +* 1 deprecation: + * Add deprecation warning to capistrano.rb. Fixes #673 + +* 4 PRs merged: + * Merge pull request #668 from kcollignon/patch-1 + * Merge pull request #754 from nathansamson/before_boot + * Merge pull request #759 from BenV/fix-centos6-build + * Merge pull request #761 from looker/no-log + === 2.12.3 / 2015-08-03 * 8 minor bugs fixed: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.md new/README.md --- old/README.md 2015-08-04 07:18:55.000000000 +0200 +++ new/README.md 2015-08-15 03:34:19.000000000 +0200 @@ -248,7 +248,7 @@ $ bundle exec cap puma:start $ bundle exec cap puma:restart $ bundle exec cap puma:stop -$ bundle exec cap puma:phased_restart +$ bundle exec cap puma:phased-restart ``` ## Contributing Files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ext/puma_http11/mini_ssl.c new/ext/puma_http11/mini_ssl.c --- old/ext/puma_http11/mini_ssl.c 2015-08-04 07:18:55.000000000 +0200 +++ new/ext/puma_http11/mini_ssl.c 2015-08-15 03:34:19.000000000 +0200 @@ -147,11 +147,13 @@ DH *dh = get_dh1024(); SSL_CTX_set_tmp_dh(ctx, dh); +#ifndef OPENSSL_NO_ECDH EC_KEY *ecdh = EC_KEY_new_by_curve_name(NID_secp521r1); if (ecdh) { SSL_CTX_set_tmp_ecdh(ctx, ecdh); EC_KEY_free(ecdh); } +#endif ssl = SSL_new(ctx); conn->ssl = ssl; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ext/puma_http11/org/jruby/puma/MiniSSL.java new/ext/puma_http11/org/jruby/puma/MiniSSL.java --- old/ext/puma_http11/org/jruby/puma/MiniSSL.java 2015-08-04 07:18:55.000000000 +0200 +++ new/ext/puma_http11/org/jruby/puma/MiniSSL.java 2015-08-15 03:34:19.000000000 +0200 @@ -1,7 +1,6 @@ package org.jruby.puma; import org.jruby.Ruby; -import org.jruby.RubyBoolean; import org.jruby.RubyClass; import org.jruby.RubyModule; import org.jruby.RubyObject; @@ -39,9 +38,6 @@ } }; - // set to true to switch on our low-fi trace logging - private static boolean DEBUG = false; - public static void createMiniSSL(Ruby runtime) { RubyModule mPuma = runtime.defineModule("Puma"); RubyModule ssl = mPuma.defineModuleUnder("MiniSSL"); @@ -170,12 +166,7 @@ public IRubyObject inject(IRubyObject arg) { try { byte[] bytes = arg.convertToString().getBytes(); - - log("Net Data post pre-inject: " + inboundNetData); inboundNetData.put(bytes); - log("Net Data post post-inject: " + inboundNetData); - - log("inject(): " + bytes.length + " encrypted bytes from request"); return this; } catch (Exception e) { e.printStackTrace(); @@ -205,8 +196,6 @@ switch (res.getStatus()) { case BUFFER_OVERFLOW: - log("SSLOp#doRun(): overflow"); - log("SSLOp#doRun(): dst data at overflow: " + dst); // increase the buffer size to accommodate the overflowing data int newSize = Math.max(engine.getSession().getPacketBufferSize(), engine.getSession().getApplicationBufferSize()); dst.resize(newSize + dst.position()); @@ -214,8 +203,6 @@ retryOp = true; break; case BUFFER_UNDERFLOW: - log("SSLOp#doRun(): underflow"); - log("SSLOp#doRun(): src data at underflow: " + src); // need to wait for more data to come in before we retry retryOp = false; break; @@ -245,25 +232,18 @@ return getRuntime().getNil(); } - log("read(): inboundNetData prepped for read: " + inboundNetData); - MiniSSLBuffer inboundAppData = new MiniSSLBuffer(engine.getSession().getApplicationBufferSize()); - SSLEngineResult res = doOp(SSLOperation.UNWRAP, inboundNetData, inboundAppData); - log("read(): after initial unwrap", engine, res); - - log("read(): Net Data post unwrap: " + inboundNetData); + doOp(SSLOperation.UNWRAP, inboundNetData, inboundAppData); HandshakeStatus handshakeStatus = engine.getHandshakeStatus(); boolean done = false; while (!done) { switch (handshakeStatus) { case NEED_WRAP: - res = doOp(SSLOperation.WRAP, inboundAppData, outboundNetData); - log("read(): after handshake wrap", engine, res); + doOp(SSLOperation.WRAP, inboundAppData, outboundNetData); break; case NEED_UNWRAP: - res = doOp(SSLOperation.UNWRAP, inboundNetData, inboundAppData); - log("read(): after handshake unwrap", engine, res); + SSLEngineResult res = doOp(SSLOperation.UNWRAP, inboundNetData, inboundAppData); if (res.getStatus() == Status.BUFFER_UNDERFLOW) { // need more data before we can shake more hands done = true; @@ -276,13 +256,9 @@ } if (inboundNetData.hasRemaining()) { - log("Net Data post pre-compact: " + inboundNetData); inboundNetData.compact(); - log("Net Data post post-compact: " + inboundNetData); } else { - log("Net Data post pre-reset: " + inboundNetData); inboundNetData.clear(); - log("Net Data post post-reset: " + inboundNetData); } ByteList appDataByteList = inboundAppData.asByteList(); @@ -292,54 +268,15 @@ RubyString str = getRuntime().newString(""); str.setValue(appDataByteList); - - logPlain("\n"); - log("read(): begin dump of request data >>>>\n"); - if (str.asJavaString().getBytes().length < 1000) { - logPlain(str.asJavaString() + "\n"); - } - logPlain("Num bytes: " + str.asJavaString().getBytes().length + "\n"); - log("read(): end dump of request data <<<<\n"); return str; } catch (Exception e) { - if (DEBUG) { - e.printStackTrace(); - } throw getRuntime().newEOFError(e.getMessage()); } } - private static void log(String str, SSLEngine engine, SSLEngineResult result) { - if (DEBUG) { - log(str + " " + result.getStatus() + "/" + engine.getHandshakeStatus() + - "---bytes consumed: " + result.bytesConsumed() + - ", bytes produced: " + result.bytesProduced()); - } - } - - private static void log(String str) { - if (DEBUG) { - System.out.println("MiniSSL.java: " + str); - } - } - - private static void logPlain(String str) { - if (DEBUG) { - System.out.println(str); - } - } - @JRubyMethod public IRubyObject write(IRubyObject arg) { try { - log("write(): begin dump of response data >>>>\n"); - logPlain("\n"); - if (arg.asJavaString().getBytes().length < 1000) { - logPlain(arg.asJavaString() + "\n"); - } - logPlain("Num bytes: " + arg.asJavaString().getBytes().length + "\n"); - log("write(): end dump of response data <<<<\n"); - byte[] bls = arg.convertToString().getBytes(); outboundAppData = new MiniSSLBuffer(bls); @@ -365,9 +302,7 @@ } outboundNetData.clear(); - SSLEngineResult res = doOp(SSLOperation.WRAP, outboundAppData, outboundNetData); - log("extract(): bytes consumed: " + res.bytesConsumed() + "\n"); - log("extract(): bytes produced: " + res.bytesProduced() + "\n"); + doOp(SSLOperation.WRAP, outboundAppData, outboundNetData); dataByteList = outboundNetData.asByteList(); if (dataByteList == null) { return getRuntime().getNil(); @@ -376,8 +311,6 @@ RubyString str = getRuntime().newString(""); str.setValue(dataByteList); - log("extract(): " + dataByteList.getRealSize() + " encrypted bytes for response"); - return str; } catch (Exception e) { e.printStackTrace(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/puma/capistrano.rb new/lib/puma/capistrano.rb --- old/lib/puma/capistrano.rb 2015-08-04 07:18:55.000000000 +0200 +++ new/lib/puma/capistrano.rb 2015-08-15 03:34:19.000000000 +0200 @@ -1,3 +1,5 @@ +$stderr.puts "DEPRECATED: To manage puma with capistrano, use https://github.com/seuros/capistrano-puma" + Capistrano::Configuration.instance.load do # Ensure the tmp/sockets directory is created by the deploy:setup task and diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/puma/cli.rb new/lib/puma/cli.rb --- old/lib/puma/cli.rb 2015-08-04 07:18:55.000000000 +0200 +++ new/lib/puma/cli.rb 2015-08-15 03:34:19.000000000 +0200 @@ -96,7 +96,7 @@ end def env - @options[:environment] || ENV['RACK_ENV'] || 'development' + @cli_options[:environment] || ENV['RACK_ENV'] || 'development' end def write_state @@ -289,43 +289,34 @@ end def find_config - if @options[:config_file] == '-' - @options[:config_file] = nil + if @cli_options[:config_file] == '-' + @cli_options[:config_file] = nil else - @options[:config_file] ||= %W(config/puma/#{env}.rb config/puma.rb).find { |f| File.exist?(f) } + @cli_options[:config_file] ||= %W(config/puma/#{env}.rb config/puma.rb).find { |f| File.exist?(f) } end end # Build the OptionParser object to handle the available options. # + def setup_options - @options = { - :min_threads => 0, - :max_threads => 16, - :quiet => false, - :debug => false, - :binds => [], - :workers => 0, - :daemon => false, - :before_worker_shutdown => [], - :before_worker_boot => [], - :before_worker_fork => [], - :after_worker_boot => [] + @cli_options = { + :binds => [] } @parser = OptionParser.new do |o| o.on "-b", "--bind URI", "URI to bind to (tcp://, unix://, ssl://)" do |arg| - @options[:binds] << arg + @cli_options[:binds] << arg end o.on "-C", "--config PATH", "Load PATH as a config file" do |arg| - @options[:config_file] = arg + @cli_options[:config_file] = arg end o.on "--control URL", "The bind url to use for the control server", "Use 'auto' to use temp unix server" do |arg| if arg - @options[:control_url] = arg + @cli_options[:control_url] = arg elsif jruby? unsupported "No default url available on JRuby" end @@ -333,26 +324,26 @@ o.on "--control-token TOKEN", "The token to use as authentication for the control server" do |arg| - @options[:control_auth_token] = arg + @cli_options[:control_auth_token] = arg end o.on "-d", "--daemon", "Daemonize the server into the background" do - @options[:daemon] = true - @options[:quiet] = true + @cli_options[:daemon] = true + @cli_options[:quiet] = true end o.on "--debug", "Log lowlevel debugging information" do - @options[:debug] = true + @cli_options[:debug] = true end o.on "--dir DIR", "Change to DIR before starting" do |d| - @options[:directory] = d.to_s - @options[:worker_directory] = d.to_s + @cli_options[:directory] = d.to_s + @cli_options[:worker_directory] = d.to_s end o.on "-e", "--environment ENVIRONMENT", "The environment to run the Rack app on (default development)" do |arg| - @options[:environment] = arg + @cli_options[:environment] = arg end o.on "-I", "--include PATH", "Specify $LOAD_PATH directories" do |arg| @@ -361,48 +352,48 @@ o.on "-p", "--port PORT", "Define the TCP port to bind to", "Use -b for more advanced options" do |arg| - @options[:binds] << "tcp://#{Configuration::DefaultTCPHost}:#{arg}" + @cli_options[:binds] << "tcp://#{Configuration::DefaultTCPHost}:#{arg}" end o.on "--pidfile PATH", "Use PATH as a pidfile" do |arg| - @options[:pidfile] = arg + @cli_options[:pidfile] = arg end o.on "--preload", "Preload the app. Cluster mode only" do - @options[:preload_app] = true + @cli_options[:preload_app] = true end o.on "--prune-bundler", "Prune out the bundler env if possible" do - @options[:prune_bundler] = true + @cli_options[:prune_bundler] = true end o.on "-q", "--quiet", "Quiet down the output" do - @options[:quiet] = true + @cli_options[:quiet] = true end o.on "-R", "--restart-cmd CMD", "The puma command to run during a hot restart", "Default: inferred" do |cmd| - @options[:restart_cmd] = cmd + @cli_options[:restart_cmd] = cmd end o.on "-S", "--state PATH", "Where to store the state details" do |arg| - @options[:state] = arg + @cli_options[:state] = arg end o.on '-t', '--threads INT', "min:max threads to use (default 0:16)" do |arg| min, max = arg.split(":") if max - @options[:min_threads] = min - @options[:max_threads] = max + @cli_options[:min_threads] = min + @cli_options[:max_threads] = max else - @options[:min_threads] = 0 - @options[:max_threads] = arg + @cli_options[:min_threads] = 0 + @cli_options[:max_threads] = arg end end o.on "--tcp-mode", "Run the app in raw TCP mode instead of HTTP mode" do - @options[:mode] = :tcp + @cli_options[:mode] = :tcp end o.on "-V", "--version", "Print the version information" do @@ -412,11 +403,11 @@ o.on "-w", "--workers COUNT", "Activate cluster mode: How many worker processes to create" do |arg| - @options[:workers] = arg.to_i + @cli_options[:workers] = arg.to_i end o.on "--tag NAME", "Additional text to display in process listing" do |arg| - @options[:tag] = arg + @cli_options[:tag] = arg end o.banner = "puma <options> <rackup file>" @@ -438,7 +429,7 @@ if s_env.ino == s_pwd.ino and (jruby? or s_env.dev == s_pwd.dev) @restart_dir = dir - @options[:worker_directory] = dir + @cli_options[:worker_directory] = dir end end @@ -528,17 +519,19 @@ def parse_options @parser.parse! @argv - @options[:rackup] = @argv.shift if @argv.last + @cli_options[:rackup] = @argv.shift if @argv.last find_config - @config = Puma::Configuration.new @options + @config = Puma::Configuration.new @cli_options # Advertise the Configuration Puma.cli_config = @config @config.load + @options = @config.options + if clustered? && (jruby? || windows?) unsupported 'worker mode not supported on JRuby or Windows' end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/puma/cluster.rb new/lib/puma/cluster.rb --- old/lib/puma/cluster.rb 2015-08-04 07:18:55.000000000 +0200 +++ new/lib/puma/cluster.rb 2015-08-15 03:34:19.000000000 +0200 @@ -379,6 +379,10 @@ @cli.write_state @master_read, @worker_write = read, @wakeup + + hooks = @options[:before_fork] + hooks.each { |h| h.call } + spawn_workers Signal.trap "SIGINT" do diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/puma/configuration.rb new/lib/puma/configuration.rb --- old/lib/puma/configuration.rb 2015-08-04 07:18:55.000000000 +0200 +++ new/lib/puma/configuration.rb 2015-08-15 03:34:19.000000000 +0200 @@ -15,26 +15,50 @@ include ConfigDefault def initialize(options) - @options = options - @options[:mode] ||= :http - @options[:binds] ||= [] - @options[:on_restart] ||= [] - @options[:before_worker_shutdown] ||= [] - @options[:before_worker_boot] ||= [] - @options[:before_worker_fork] ||= [] - @options[:after_worker_boot] ||= [] - @options[:worker_timeout] ||= DefaultWorkerTimeout - @options[:worker_shutdown_timeout] ||= DefaultWorkerShutdownTimeout + @cli_options = options + + @conf = {} + @conf[:mode] ||= :http + @conf[:binds] ||= [] + @conf[:on_restart] ||= [] + @conf[:before_fork] ||= [] + @conf[:before_worker_shutdown] ||= [] + @conf[:before_worker_boot] ||= [] + @conf[:before_worker_fork] ||= [] + @conf[:after_worker_boot] ||= [] + @conf[:worker_timeout] ||= DefaultWorkerTimeout + @conf[:worker_shutdown_timeout] ||= DefaultWorkerShutdownTimeout + + @options = {} end attr_reader :options def initialize_copy(other) - @options = @options.dup + @conf = @conf.dup + end + + def default_options + { + :min_threads => 0, + :max_threads => 16, + :quiet => false, + :debug => false, + :binds => [], + :workers => 0, + :daemon => false, + } end def load - DSL.load(@options, @options[:config_file]) + DSL.load(@conf, @cli_options[:config_file]) + + # Load the options in the right priority + # + @options = {} + @options.merge! default_options + @options.merge! @conf + @options.merge! @cli_options setup_binds setup_control diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/puma/const.rb new/lib/puma/const.rb --- old/lib/puma/const.rb 2015-08-04 07:18:55.000000000 +0200 +++ new/lib/puma/const.rb 2015-08-15 03:34:19.000000000 +0200 @@ -99,8 +99,8 @@ # too taxing on performance. module Const - PUMA_VERSION = VERSION = "2.12.3".freeze - CODE_NAME = "Plutonian Photo Shoot".freeze + PUMA_VERSION = VERSION = "2.13.0".freeze + CODE_NAME = "A Midsummer Code's Dream".freeze FAST_TRACK_KA_TIMEOUT = 0.2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/puma/dsl.rb new/lib/puma/dsl.rb --- old/lib/puma/dsl.rb 2015-08-04 07:18:55.000000000 +0200 +++ new/lib/puma/dsl.rb 2015-08-15 03:34:19.000000000 +0200 @@ -156,6 +156,19 @@ @options[:workers] = count.to_i end + # *Cluster mode only* Code to run immediately before master process + # forks workers (once on boot). These hooks can block if necessary + # to wait for background operations unknown to puma to finish before + # the process terminates. + # This can be used to close any connections to remote servers (database, redis, ...) + # that were opened when preloading the code + # + # This can be called multiple times to add hooks. + # + def before_fork(&block) + @options[:before_fork] << block + end + # *Cluster mode only* Code to run immediately before a worker shuts # down (after it has finished processing HTTP requests). These hooks # can block if necessary to wait for background operations unknown diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2015-08-04 07:18:55.000000000 +0200 +++ new/metadata 2015-08-15 03:34:19.000000000 +0200 @@ -1,14 +1,14 @@ --- !ruby/object:Gem::Specification name: puma version: !ruby/object:Gem::Version - version: 2.12.3 + version: 2.13.0 platform: ruby authors: - Evan Phoenix autorequire: bindir: bin cert_chain: [] -date: 2015-08-04 00:00:00.000000000 Z +date: 2015-08-15 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: rdoc