Hello community, here is the log from the commit of package rubygem-puma for openSUSE:Factory checked in at 2015-11-10 10:03:21 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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-09-24 06:14:31.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-puma.new/rubygem-puma.changes 2015-11-10 10:03:30.000000000 +0100 @@ -1,0 +2,71 @@ +Sat Nov 7 05:31:46 UTC 2015 - [email protected] + +- updated to version 2.15.2 + see installed History.txt + + === 2.15.2 / 2015-11-06 + + * 2 bug fixes: + * ext/puma_http11: handle duplicate headers as per RFC + * Only set ctx.ca iff there is a params['ca'] to set with. + + * 2 PRs merged: + * Merge pull request #818 from unleashed/support-duplicate-headers + * Merge pull request #819 from VictorLowther/fix-ca-and-verify_null-exception + + === 2.15.1 / 2015-11-06 + + * 1 bug fix: + + * Allow older openssl versions + + === 2.15.0 / 2015-11-06 + + * 6 minor features: + * Allow setting ca without setting a verify mode + * Make jungle for init.d support rbenv + * Use SSL_CTX_use_certificate_chain_file for full chain + * cluster: add worker_boot_timeout option + * configuration: allow empty tags to mean no tag desired + * puma/cli: support specifying STD{OUT,ERR} redirections and append mode + + * 5 bug fixes: + * Disable SSL Compression + * Fix bug setting worker_directory when using a symlink directory + * Fix error message in DSL that was slightly inaccurate + * Pumactl: set correct process name. Fixes #563 + * thread_pool: fix race condition when shutting down workers + + * 10 doc fixes: + * Add before_fork explanation in Readme.md + * Correct spelling in DEPLOYMENT.md + * Correct spelling in docs/nginx.md + * Fix spelling errors. + * Fix typo in deployment description + * Fix typos (it's -> its) in events.rb and server.rb + * fixing for typo mentioned in #803 + * Spelling correction for README + * thread_pool: fix typos in comment + * More explicit docs for worker_timeout + + * 18 PRs merged: + * Merge pull request #768 from nathansamson/patch-1 + * Merge pull request #773 from rossta/spelling_corrections + * Merge pull request #774 from snow/master + * Merge pull request #781 from sunsations/fix-typo + * Merge pull request #791 from unleashed/allow_empty_tags + * Merge pull request #793 from robdimarco/fix-working-directory-symlink-bug + * Merge pull request #794 from peterkeen/patch-1 + * Merge pull request #795 from unleashed/redirects-from-cmdline + * Merge pull request #796 from cschneid/fix_dsl_message + * Merge pull request #799 from annafw/master + * Merge pull request #800 from liamseanbrady/fix_typo + * Merge pull request #801 from scottjg/ssl-chain-file + * Merge pull request #802 from scottjg/ssl-crimes + * Merge pull request #804 from burningTyger/patch-2 + * Merge pull request #809 from unleashed/threadpool-fix-race-in-shutdown + * Merge pull request #810 from vlmonk/fix-pumactl-restart-bug + * Merge pull request #814 from schneems/schneems/worker_timeout-docs + * Merge pull request #817 from unleashed/worker-boot-timeout + +------------------------------------------------------------------- Old: ---- puma-2.14.0.gem New: ---- puma-2.15.2.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-puma.spec ++++++ --- /var/tmp/diff_new_pack.9JL4X7/_old 2015-11-10 10:03:31.000000000 +0100 +++ /var/tmp/diff_new_pack.9JL4X7/_new 2015-11-10 10:03:31.000000000 +0100 @@ -24,7 +24,7 @@ # Name: rubygem-puma -Version: 2.14.0 +Version: 2.15.2 Release: 0 %define mod_name puma %define mod_full_name %{mod_name}-%{version} ++++++ puma-2.14.0.gem -> puma-2.15.2.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DEPLOYMENT.md new/DEPLOYMENT.md --- old/DEPLOYMENT.md 2015-09-18 18:56:34.000000000 +0200 +++ new/DEPLOYMENT.md 2015-11-07 00:35:53.000000000 +0100 @@ -1,7 +1,7 @@ # Deployment engineering for puma Puma is software that is expected to be run in a deployed environment eventually. -You can centainly use it as your dev server only, but most people look to use +You can certainly use it as your dev server only, but most people look to use it in their production deployments as well. To that end, this is meant to serve as a foundation of wisdom how to do that @@ -17,7 +17,7 @@ ## Single vs Cluster mode -Puma was originally concieved as a thread-only webserver, but grew the ability to +Puma was originally conceived as a thread-only webserver, but grew the ability to also use processes in version 2. Here are some rules of thumb: @@ -27,7 +27,7 @@ * Use cluster mode and set the number of workers to 1.5x the number of cpu cores in the machine, minimum 2. * Set the number of threads to desired concurrent requests / number of workers. - Puma defaults to 8 and thats a decent number. + Puma defaults to 8 and that's a decent number. #### Migrating from Unicorn diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/History.txt new/History.txt --- old/History.txt 2015-09-18 18:56:34.000000000 +0200 +++ new/History.txt 2015-11-07 00:35:53.000000000 +0100 @@ -1,3 +1,68 @@ +=== 2.15.2 / 2015-11-06 + +* 2 bug fixes: + * ext/puma_http11: handle duplicate headers as per RFC + * Only set ctx.ca iff there is a params['ca'] to set with. + +* 2 PRs merged: + * Merge pull request #818 from unleashed/support-duplicate-headers + * Merge pull request #819 from VictorLowther/fix-ca-and-verify_null-exception + +=== 2.15.1 / 2015-11-06 + +* 1 bug fix: + + * Allow older openssl versions + +=== 2.15.0 / 2015-11-06 + +* 6 minor features: + * Allow setting ca without setting a verify mode + * Make jungle for init.d support rbenv + * Use SSL_CTX_use_certificate_chain_file for full chain + * cluster: add worker_boot_timeout option + * configuration: allow empty tags to mean no tag desired + * puma/cli: support specifying STD{OUT,ERR} redirections and append mode + +* 5 bug fixes: + * Disable SSL Compression + * Fix bug setting worker_directory when using a symlink directory + * Fix error message in DSL that was slightly inaccurate + * Pumactl: set correct process name. Fixes #563 + * thread_pool: fix race condition when shutting down workers + +* 10 doc fixes: + * Add before_fork explanation in Readme.md + * Correct spelling in DEPLOYMENT.md + * Correct spelling in docs/nginx.md + * Fix spelling errors. + * Fix typo in deployment description + * Fix typos (it's -> its) in events.rb and server.rb + * fixing for typo mentioned in #803 + * Spelling correction for README + * thread_pool: fix typos in comment + * More explicit docs for worker_timeout + +* 18 PRs merged: + * Merge pull request #768 from nathansamson/patch-1 + * Merge pull request #773 from rossta/spelling_corrections + * Merge pull request #774 from snow/master + * Merge pull request #781 from sunsations/fix-typo + * Merge pull request #791 from unleashed/allow_empty_tags + * Merge pull request #793 from robdimarco/fix-working-directory-symlink-bug + * Merge pull request #794 from peterkeen/patch-1 + * Merge pull request #795 from unleashed/redirects-from-cmdline + * Merge pull request #796 from cschneid/fix_dsl_message + * Merge pull request #799 from annafw/master + * Merge pull request #800 from liamseanbrady/fix_typo + * Merge pull request #801 from scottjg/ssl-chain-file + * Merge pull request #802 from scottjg/ssl-crimes + * Merge pull request #804 from burningTyger/patch-2 + * Merge pull request #809 from unleashed/threadpool-fix-race-in-shutdown + * Merge pull request #810 from vlmonk/fix-pumactl-restart-bug + * Merge pull request #814 from schneems/schneems/worker_timeout-docs + * Merge pull request #817 from unleashed/worker-boot-timeout + === 2.14.0 / 2015-09-18 * 1 minor feature: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.md new/README.md --- old/README.md 2015-09-18 18:56:34.000000000 +0200 +++ new/README.md 2015-11-07 00:35:53.000000000 +0100 @@ -117,6 +117,25 @@ end end +On top of that, you can specify a block in your configuration file that will be run before workers are forked + + # config/puma.rb + before_fork do + # configuration here + end + +This code can be used to clean up before forking to clients, allowing +you to do some Puma-specific things that you don't want to embed in your application. + +If you're preloading your application and using ActiveRecord, it's recommend you close any connections to the database here to prevent connection leakage: + + # config/puma.rb + before_fork do + ActiveRecord::Base.connection_pool.disconnect! + end + +This rule applies to any connections to external services (Redis, databases, memcache, ...) that might be started automatically by the framework. + When you use preload_app, your new code goes all in the master process, and is then copied in the workers (meaning it’s only compatible with cluster mode). General rule is to use preload_app when your workers die often and need fast starts. If you don’t have many workers, you probably should not use preload_app. Note that preload_app can’t be used with phased restart, since phased restart kills and restarts workers one-by-one, and preload_app is all about copying the code of master into the workers. @@ -167,7 +186,7 @@ $ puma -C /path/to/config -By default, if no configuration file is specifed, Puma will look for a configuration file at config/puma.rb. If an environment is specified, either via the `-e` and `--environment` flags, or through the `RACK_ENV` environment variable, the default file location will be config/puma/environment_name.rb. +By default, if no configuration file is specified, Puma will look for a configuration file at config/puma.rb. If an environment is specified, either via the `-e` and `--environment` flags, or through the `RACK_ENV` environment variable, the default file location will be config/puma/environment_name.rb. If you want to prevent Puma from looking for a configuration file in those locations, provide a dash as the argument to the `-C` (or `--config`) flag: Files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/docs/nginx.md new/docs/nginx.md --- old/docs/nginx.md 2015-09-18 18:56:34.000000000 +0200 +++ new/docs/nginx.md 2015-11-07 00:35:53.000000000 +0100 @@ -40,7 +40,7 @@ } # check for index.html for directory index - # if its there on the filesystem then rewite + # if it's there on the filesystem then rewrite # the url to add /index.html to the end of it # and then break to send it to the next config rules. if (-f $request_filename/index.html) { 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-09-18 18:56:35.000000000 +0200 +++ new/ext/puma_http11/mini_ssl.c 2015-11-07 00:35:53.000000000 +0100 @@ -11,6 +11,10 @@ #include <openssl/err.h> #include <openssl/x509.h> +#ifndef SSL_OP_NO_COMPRESSION +#define SSL_OP_NO_COMPRESSION 0 +#endif + typedef struct { BIO* read; BIO* write; @@ -136,14 +140,14 @@ ctx = SSL_CTX_new(SSLv23_server_method()); conn->ctx = ctx; - SSL_CTX_use_certificate_file(ctx, RSTRING_PTR(cert), SSL_FILETYPE_PEM); + SSL_CTX_use_certificate_chain_file(ctx, RSTRING_PTR(cert)); SSL_CTX_use_PrivateKey_file(ctx, RSTRING_PTR(key), SSL_FILETYPE_PEM); if (!NIL_P(ca)) { SSL_CTX_load_verify_locations(ctx, RSTRING_PTR(ca), NULL); } - SSL_CTX_set_options(ctx, SSL_OP_CIPHER_SERVER_PREFERENCE | SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_SINGLE_DH_USE | SSL_OP_SINGLE_ECDH_USE); + SSL_CTX_set_options(ctx, SSL_OP_CIPHER_SERVER_PREFERENCE | SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_SINGLE_DH_USE | SSL_OP_SINGLE_ECDH_USE | SSL_OP_NO_COMPRESSION); SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_OFF); SSL_CTX_set_cipher_list(ctx, "HIGH:!aNULL@STRENGTH"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ext/puma_http11/org/jruby/puma/Http11.java new/ext/puma_http11/org/jruby/puma/Http11.java --- old/ext/puma_http11/org/jruby/puma/Http11.java 2015-09-18 18:56:35.000000000 +0200 +++ new/ext/puma_http11/org/jruby/puma/Http11.java 2015-11-07 00:35:53.000000000 +0100 @@ -82,11 +82,11 @@ private Http11Parser.FieldCB http_field = new Http11Parser.FieldCB() { public void call(Object data, int field, int flen, int value, int vlen) { RubyHash req = (RubyHash)data; - RubyString v,f; + RubyString f; + IRubyObject v; validateMaxLength(flen, MAX_FIELD_NAME_LENGTH, MAX_FIELD_NAME_LENGTH_ERR); validateMaxLength(vlen, MAX_FIELD_VALUE_LENGTH, MAX_FIELD_VALUE_LENGTH_ERR); - v = RubyString.newString(runtime, new ByteList(Http11.this.hp.parser.buffer,value,vlen)); ByteList b = new ByteList(Http11.this.hp.parser.buffer,field,flen); for(int i = 0,j = b.length();i<j;i++) { if((b.get(i) & 0xFF) == '-') { @@ -104,7 +104,16 @@ f = RubyString.newString(runtime, "HTTP_"); f.cat(b); } - req.op_aset(req.getRuntime().getCurrentContext(), f,v); + + b = new ByteList(Http11.this.hp.parser.buffer, value, vlen); + v = req.op_aref(req.getRuntime().getCurrentContext(), f); + if (v.isNil()) { + req.op_aset(req.getRuntime().getCurrentContext(), f, RubyString.newString(runtime, b)); + } else { + RubyString vs = v.convertToString(); + vs.cat(", "); + vs.cat(b); + } } }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ext/puma_http11/puma_http11.c new/ext/puma_http11/puma_http11.c --- old/ext/puma_http11/puma_http11.c 2015-09-18 18:56:35.000000000 +0200 +++ new/ext/puma_http11/puma_http11.c 2015-11-07 00:35:53.000000000 +0100 @@ -176,14 +176,12 @@ void http_field(puma_parser* hp, const char *field, size_t flen, const char *value, size_t vlen) { - VALUE v = Qnil; VALUE f = Qnil; + VALUE v; VALIDATE_MAX_LENGTH(flen, FIELD_NAME); VALIDATE_MAX_LENGTH(vlen, FIELD_VALUE); - v = rb_str_new(value, vlen); - f = find_common_field_value(field, flen); if (f == Qnil) { @@ -201,7 +199,17 @@ f = rb_str_new(hp->buf, new_size); } - rb_hash_aset(hp->request, f, v); + /* check for duplicate header */ + v = rb_hash_aref(hp->request, f); + + if (v == Qnil) { + v = rb_str_new(value, vlen); + rb_hash_aset(hp->request, f, v); + } else { + /* if duplicate header, normalize to comma-separated values */ + rb_str_cat2(v, ", "); + rb_str_cat(v, value, vlen); + } } void request_method(puma_parser* hp, const char *at, size_t length) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/puma/binder.rb new/lib/puma/binder.rb --- old/lib/puma/binder.rb 2015-09-18 18:56:35.000000000 +0200 +++ new/lib/puma/binder.rb 2015-11-07 00:35:53.000000000 +0100 @@ -164,8 +164,9 @@ unless params['ca'] @events.error "Please specify the SSL ca via 'ca='" end - ctx.ca = params['ca'] end + + ctx.ca = params['ca'] if params['ca'] if params['verify_mode'] ctx.verify_mode = case params['verify_mode'] 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-09-18 18:56:35.000000000 +0200 +++ new/lib/puma/cli.rb 2015-11-07 00:35:53.000000000 +0100 @@ -266,7 +266,7 @@ private def title buffer = "puma #{Puma::Const::VERSION} (#{@options[:binds].join(',')})" - buffer << " [#{@options[:tag]}]" if @options[:tag] + buffer << " [#{@options[:tag]}]" if @options[:tag] && !@options[:tag].empty? buffer end @@ -410,6 +410,18 @@ @cli_options[:tag] = arg end + o.on "--redirect-stdout FILE", "Redirect STDOUT to a specific file" do |arg| + @cli_options[:redirect_stdout] = arg + end + + o.on "--redirect-stderr FILE", "Redirect STDERR to a specific file" do |arg| + @cli_options[:redirect_stderr] = arg + end + + o.on "--[no-]redirect-append", "Append to redirected files" do |val| + @cli_options[:redirect_append] = val + end + o.banner = "puma <options> <rackup file>" o.on_tail "-h", "--help", "Show help" do @@ -429,7 +441,7 @@ if s_env.ino == s_pwd.ino and (jruby? or s_env.dev == s_pwd.dev) @restart_dir = dir - @cli_options[:worker_directory] = dir + @options[:worker_directory] = dir end 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-09-18 18:56:35.000000000 +0200 +++ new/lib/puma/cluster.rb 2015-11-07 00:35:53.000000000 +0100 @@ -136,6 +136,7 @@ any = false @workers.each do |w| + next if !w.booted? && !w.ping_timeout?(@options[:worker_boot_timeout]) if w.ping_timeout?(@options[:worker_timeout]) log "! Terminating timed out worker: #{w.pid}" w.kill @@ -186,7 +187,7 @@ def worker(index, master) title = "puma: cluster worker #{index}: #{master}" - title << " [#{@options[:tag]}]" if @options[:tag] + title << " [#{@options[:tag]}]" if @options[:tag] && !@options[:tag].empty? $0 = title Signal.trap "SIGINT", "IGNORE" @@ -221,7 +222,7 @@ begin @worker_write << "b#{Process.pid}\n" rescue SystemCallError, IOError - STDERR.puts "Master seems to have exitted, exitting." + STDERR.puts "Master seems to have exited, exiting." return end 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-09-18 18:56:35.000000000 +0200 +++ new/lib/puma/configuration.rb 2015-11-07 00:35:53.000000000 +0100 @@ -27,6 +27,7 @@ @conf[:before_worker_fork] ||= [] @conf[:after_worker_boot] ||= [] @conf[:worker_timeout] ||= DefaultWorkerTimeout + @conf[:worker_boot_timeout] ||= @conf[:worker_timeout] @conf[:worker_shutdown_timeout] ||= DefaultWorkerShutdownTimeout @options = {} 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-09-18 18:56:35.000000000 +0200 +++ new/lib/puma/const.rb 2015-11-07 00:35:53.000000000 +0100 @@ -99,8 +99,8 @@ # too taxing on performance. module Const - PUMA_VERSION = VERSION = "2.14.0".freeze - CODE_NAME = "Fuchsia Friday".freeze + PUMA_VERSION = VERSION = "2.15.2".freeze + CODE_NAME = "Autumn Arbor Airbrush".freeze FAST_TRACK_KA_TIMEOUT = 0.2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/puma/control_cli.rb new/lib/puma/control_cli.rb --- old/lib/puma/control_cli.rb 2015-09-18 18:56:35.000000000 +0200 +++ new/lib/puma/control_cli.rb 2015-11-07 00:35:53.000000000 +0100 @@ -262,6 +262,10 @@ events = Puma::Events.new @stdout, @stderr + # replace $0 because puma use it to generate restart command + puma_cmd = $0.gsub(/pumactl$/, 'puma') + $0 = puma_cmd if File.exist?(puma_cmd) + cli = Puma::CLI.new run_args, events cli.run end 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-09-18 18:56:35.000000000 +0200 +++ new/lib/puma/dsl.rb 2015-11-07 00:35:53.000000000 +0100 @@ -132,7 +132,7 @@ min = Integer(min) max = Integer(max) if min > max - raise "The minimum (#{min}) number of threads must be less than the max (#{max})" + raise "The minimum (#{min}) number of threads must be less than or equal to the max (#{max})" end @options[:min_threads] = min @@ -256,11 +256,19 @@ @options[:tag] = string end - # *Cluster mode only* Set the timeout for workers + # *Cluster mode only* Set the timeout for workers in seconds + # When set the master process will terminate any workers + # that have not checked in within the given +timeout+. + # This mitigates hung processes. Default value is 60 seconds. def worker_timeout(timeout) @options[:worker_timeout] = timeout end + # *Cluster mode only* Set the timeout for workers to boot + def worker_boot_timeout(timeout) + @options[:worker_boot_timeout] = timeout + end + # *Cluster mode only* Set the timeout for worker shutdown def worker_shutdown_timeout(timeout) @options[:worker_shutdown_timeout] = timeout diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/puma/events.rb new/lib/puma/events.rb --- old/lib/puma/events.rb 2015-09-18 18:56:35.000000000 +0200 +++ new/lib/puma/events.rb 2015-11-07 00:35:53.000000000 +0100 @@ -128,7 +128,7 @@ DEFAULT = new(STDOUT, STDERR) - # Returns an Events object which writes it's status to 2 StringIO + # Returns an Events object which writes its status to 2 StringIO # objects. # def self.strings diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/puma/server.rb new/lib/puma/server.rb --- old/lib/puma/server.rb 2015-09-18 18:56:35.000000000 +0200 +++ new/lib/puma/server.rb 2015-11-07 00:35:53.000000000 +0100 @@ -45,7 +45,7 @@ # to be handled. See Puma::Events for the list of current methods to implement. # # Server#run returns a thread that you can join on to wait for the server - # to do it's work. + # to do its work. # def initialize(app, events=Events.stdio, options={}) @app = app diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/puma/single.rb new/lib/puma/single.rb --- old/lib/puma/single.rb 2015-09-18 18:56:35.000000000 +0200 +++ new/lib/puma/single.rb 2015-11-07 00:35:53.000000000 +0100 @@ -62,7 +62,7 @@ end Signal.trap "SIGCHLD" do - log "! Error starting new process as daemon, exitting" + log "! Error starting new process as daemon, exiting" exit 1 end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/puma/thread_pool.rb new/lib/puma/thread_pool.rb --- old/lib/puma/thread_pool.rb 2015-09-18 18:56:35.000000000 +0200 +++ new/lib/puma/thread_pool.rb 2015-11-07 00:35:53.000000000 +0100 @@ -160,7 +160,7 @@ end # If there are dead threads in the pool make them go away while decreasing - # spwaned counter so that new healty threads could be created again. + # spawned counter so that new healthy threads could be created again. def reap @mutex.synchronize do dead_workers = @workers.reject(&:alive?) @@ -235,20 +235,18 @@ # Tell all threads in the pool to exit and wait for them to finish. # def shutdown - @mutex.synchronize do + threads = @mutex.synchronize do @shutdown = true @not_empty.broadcast @not_full.broadcast @auto_trim.stop if @auto_trim @reaper.stop if @reaper + # dup workers so that we join them all safely + @workers.dup end - # Use this instead of #each so that we don't stop in the middle - # of each and see a mutated object mid #each - if [email protected]? - @workers.first.join until @workers.empty? - end + threads.each(&:join) @spawned = 0 @workers = [] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rack/handler/puma.rb new/lib/rack/handler/puma.rb --- old/lib/rack/handler/puma.rb 2015-09-18 18:56:35.000000000 +0200 +++ new/lib/rack/handler/puma.rb 2015-11-07 00:35:53.000000000 +0100 @@ -50,7 +50,7 @@ "Host=HOST" => "Hostname to listen on (default: localhost)", "Port=PORT" => "Port to listen on (default: 8080)", "Threads=MIN:MAX" => "min:max threads to use (default 0:16)", - "Quiet" => "Don't report each request" + "Verbose" => "Don't report each request (default: false)" } end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2015-09-18 18:56:34.000000000 +0200 +++ new/metadata 2015-11-07 00:35:53.000000000 +0100 @@ -1,14 +1,14 @@ --- !ruby/object:Gem::Specification name: puma version: !ruby/object:Gem::Version - version: 2.14.0 + version: 2.15.2 platform: ruby authors: - Evan Phoenix autorequire: bindir: bin cert_chain: [] -date: 2015-09-18 00:00:00.000000000 Z +date: 2015-11-06 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: rdoc diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/tools/jungle/init.d/puma new/tools/jungle/init.d/puma --- old/tools/jungle/init.d/puma 2015-09-18 18:56:35.000000000 +0200 +++ new/tools/jungle/init.d/puma 2015-11-07 00:35:53.000000000 +0100 @@ -23,6 +23,7 @@ CONFIG=/etc/puma.conf JUNGLE=`cat $CONFIG` RUNPUMA=/usr/local/bin/run-puma +USE_LOCAL_BUNDLE=0 # Load the VERBOSE setting and other rcS variables . /lib/init/vars.sh @@ -105,7 +106,11 @@ log_daemon_msg "---> Puma $1 isn't running." else log_daemon_msg "---> About to kill PID `cat $PIDFILE`" - pumactl --state $STATEFILE stop + if [ "$USE_LOCAL_BUNDLE" -eq 1 ]; then + cd $1 && bundle exec pumactl --state $STATEFILE stop + else + pumactl --state $STATEFILE stop + fi # Many daemons don't delete their pidfiles when they exit. rm -f $PIDFILE $STATEFILE fi @@ -135,7 +140,11 @@ if [ -e $PIDFILE ]; then log_daemon_msg "--> About to restart puma $1" - pumactl --state $dir/tmp/puma/state restart + if [ "$USE_LOCAL_BUNDLE" -eq 1 ]; then + cd $1 && bundle exec pumactl --state $dir/tmp/puma/state restart + else + pumactl --state $dir/tmp/puma/state restart + fi # kill -s USR2 `cat $PIDFILE` # TODO Check if process exist else @@ -175,7 +184,11 @@ if [ -e $PIDFILE ]; then log_daemon_msg "--> About to status puma $1" - pumactl --state $dir/tmp/puma/state stats + if [ "$USE_LOCAL_BUNDLE" -eq 1 ]; then + cd $1 && bundle exec pumactl --state $dir/tmp/puma/state stats + else + pumactl --state $dir/tmp/puma/state stats + fi # kill -s USR2 `cat $PIDFILE` # TODO Check if process exist else @@ -241,6 +254,40 @@ fi } +config_bundler() { + HOME="$(eval echo ~$(id -un))" + if [ -d "/usr/local/rbenv/bin" ]; then + PATH="/usr/local/rbenv/bin:/usr/local/rbenv/shims:$PATH" + eval "$(rbenv init -)" + USE_LOCAL_BUNDLE=1 + return 0 + elif [ -d "$HOME/.rbenv/bin" ]; then + PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH" + eval "$(rbenv init -)" + USE_LOCAL_BUNDLE=1 + return 0 + # TODO: test rvm + # elif [ -f /etc/profile.d/rvm.sh ]; then + # source /etc/profile.d/rvm.sh + # elif [ -f /usr/local/rvm/scripts/rvm ]; then + # source /etc/profile.d/rvm.sh + # elif [ -f "$HOME/.rvm/scripts/rvm" ]; then + # source "$HOME/.rvm/scripts/rvm" + # TODO: don't know what to do with chruby + # elif [ -f /usr/local/share/chruby/chruby.sh ]; then + # source /usr/local/share/chruby/chruby.sh + # if [ -f /usr/local/share/chruby/auto.sh ]; then + # source /usr/local/share/chruby/auto.sh + # fi + # if you aren't using auto, set your version here + # chruby 2.0.0 + fi + + return 1 +} + +config_bundler + case "$1" in start) [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
