Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 08:41
    choallin commented #3044
  • 06:06
    AkankshaSh commented #1523
  • Feb 04 22:43
    MSP-Greg edited #3073
  • Feb 04 22:41
    MSP-Greg labeled #3073
  • Feb 04 22:34
    MSP-Greg opened #3073
  • Feb 04 21:42
    MSP-Greg synchronize #3072
  • Feb 04 17:30
    MSP-Greg edited #3072
  • Feb 04 17:18
    MSP-Greg synchronize #3072
  • Feb 04 05:30
    MSP-Greg edited #3072
  • Feb 04 05:26
    MSP-Greg synchronize #3072
  • Feb 03 15:11
    Exterm1nate commented #2534
  • Feb 03 05:03
    MSP-Greg edited #3072
  • Feb 03 05:02
    MSP-Greg edited #3072
  • Feb 03 05:01
    MSP-Greg edited #3072
  • Feb 03 05:00
    MSP-Greg edited #3072
  • Feb 03 04:59
    MSP-Greg commented #3072
  • Feb 03 03:03
    MSP-Greg commented #3072
  • Feb 03 01:41
    MSP-Greg labeled #3072
  • Feb 03 01:41
    MSP-Greg opened #3072
  • Feb 02 17:55
    mcfadden opened #3071
Brian Shirai
@brixen
MRI needs to define the semantics of this
what if the Autoload you specify names the file itself?
what if it names a file that is already in $LOADED_FEATURES but didn't define Foo?
etc
Mike Pastore
@mwpastore
I thought require kept a hash of loaded files and won’t load a file twice
Brian Shirai
@brixen
exactly
so what happens when you specify a file that has been required for an autoload?
what if that file didn't define Foo
does the autoload fail?
does class Foo just create the class?
Mike Pastore
@mwpastore
mwp@aphrodite:~/src/rubinius-autoload$ ruby -v
rubinius 2.5.8 (2.1.0 bef51ae3 2015-09-28 3.4 JI) [x86_64-linux-gnu]
mwp@aphrodite:~/src/rubinius-autoload$ cat foo_loop.rb 
autoload :Foo, './foo_loop.rb’

class Foo
end
mwp@aphrodite:~/src/rubinius-autoload$ ruby foo_loop.rb
mwp@aphrodite:~/src/rubinius-autoload$ echo $?
0
Brian Shirai
@brixen
basically Rubinius just does whatever someone thought to write specs for
Ruby is extremely complex, under-specified, and poorly specified where it is
so, we'll see what MRI says
Mike Pastore
@mwpastore
Sounds good!
Chris
@ipatch
hello i'm trying to deploy a rails app with puma using cap, and trying to bind puma to a specific port and have set that in config/deploy/production.rb but the app isn't loading :/
raelik
@raelik
Is there a best practice for embedding a puma server into a multi-threaded ruby app? Namely, not using the puma cli
also, this would be on jruby, so no worries about the GIL getting in the way
Mike Pastore
@mwpastore
@raelik If you install the puma gem under JRuby doesn’t it just run puma using JRuby?
@raelik And if you’re deploying to another application server, do you even need puma?
raelik
@raelik
The app in question is a standalone jruby application, and puma would just be used to provide a json endpoint for monitoring it.
so I don't want to run the app with the puma command, as it already has its own command-line
raelik
@raelik
I've got a way to start it (Events.new, Binder.new & add_tcp_listener, Server.new), just didn't know if there was a more streamlined way
raelik
@raelik
actually, looks like I can call add_tcp_listener directly on the Server, since it'll create it's own Binder instance if necessary
so that'll work
Mike Pastore
@mwpastore
Interesting! I’ve seen other ways to do what you’re doing but that’s pretty cool
raelik
@raelik
    def puma_init
      conf = @config[:puma]
      events = case options[:log].nil?
        when false
          Puma::Events::DEFAULT
        else
          f = File.open(options[:log],'a+')
          e = Puma::Events.new(f, f)
          e.register(:state) {|s| f.close if s == :done }
          e
      end
      server = Puma::Server.new(@monitor,events)
      server.add_tcp_listener(conf[:host] || '127.0.0.1', conf[:port] || '9292')
      server.min_threads = 0
      server.max_threads = conf[:threads] || 1
      server
    end
that's my method for manually initializing puma
raelik
@raelik
@monitor is a rack app initialized elsewhere, @config is a YAML config parsed into a hash, and options comes from methadone.
Mike Pastore
@mwpastore
Anybody working on running Puma on Ruby 2.3 with --enable=frozen-string-literal? I’m trying to fix up enough of the built-in gems in the preview just to get rake test to go :-\
James Moriarty
@jamesmoriarty
Hey, anyone know what dependencies I need to install puma on apline linux. Thanks. :)
James Moriarty
@jamesmoriarty
apk add --no-cache git imagemagick make gcc libc-dev libxml2-dev libxslt-dev libffi-dev yaml-dev openssl-dev zlib-dev readline-dev
Worked but I think I can eliminate some of those.
Philip Champon
@flah00
hi-o, i'm wondering if anyone has run into issues with puma master reconnecting to active record, using preload_app! and before_fork disconnect!. All of my rails app disconnect, except for redmine, which reconnects after 1 - 2 days.
this is with puma-2.16.0, rails-4.2.5, and pg-0.18.4
danilogarcia024
@danilogarcia024
I trying to run my app
When I started it the following message appear me
But it's just in Production

MacBook-Pro-de-Danilo:apc-directory danilogarcia024$ rails s puma -e production
/Users/danilogarcia024/.rvm/gems/ruby-2.0.0-p643/gems/bundler-1.11.2/lib/bundler.rb:289: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
/Users/danilogarcia024/.rvm/gems/ruby-2.0.0-p643/gems/bundler-1.11.2/lib/bundler.rb:289: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
=> Booting Puma
=> Rails 4.1.6 application starting in production on http://0.0.0.0:3000
=> Run rails server -h for more startup options
=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
=> Ctrl-C to shutdown server
Puma 2.13.4 starting...

  • Min threads: 0, max threads: 16
  • Environment: production
  • Listening on tcp://0.0.0.0:3000
    2016-03-16 21:35:04 -0500: HTTP parse error, malformed request (): #<Puma::HttpParserError: Invalid HTTP format, parsing fails.>2016-03-16 21:35:04 -0500: HTTP parse error, malformed request (): #<Puma::HttpParserError: Invalid HTTP format, parsing fails.>
    2016-03-16 21:35:04 -0500: ENV: {"rack.version"=>[1, 3], "rack.errors"=>#<IO:<STDERR>>, "rack.multithread"=>true, "rack.multiprocess"=>false, "rack.run_once"=>false, "SCRIPT_NAME"=>"", "QUERY_STRING"=>"", "SERVER_PROTOCOL"=>"HTTP/1.1", "SERVER_SOFTWARE"=>"2.13.4", "GATEWAY_INTERFACE"=>"CGI/1.2"}

2016-03-16 21:35:04 -0500: HTTP parse error, malformed request (): #<Puma::HttpParserError: Invalid HTTP format, parsing fails.>

2016-03-16 21:35:04 -0500: ENV: {"rack.version"=>[1, 3], "rack.errors"=>#<IO:<STDERR>>, "rack.multithread"=>true, "rack.multiprocess"=>false, "rack.run_once"=>false, "SCRIPT_NAME"=>"", "QUERY_STRING"=>"", "SERVER_PROTOCOL"=>"HTTP/1.1", "SERVER_SOFTWARE"=>"2.13.4", "GATEWAY_INTERFACE"=>"CGI/1.2"}

2016-03-16 21:35:04 -0500: ENV: {"rack.version"=>[1, 3], "rack.errors"=>#<IO:<STDERR>>, "rack.multithread"=>true, "rack.multiprocess"=>false, "rack.run_once"=>false, "SCRIPT_NAME"=>"", "QUERY_STRING"=>"", "SERVER_PROTOCOL"=>"HTTP/1.1", "SERVER_SOFTWARE"=>"2.13.4", "GATEWAY_INTERFACE"=>"CGI/1.2"}

2016-03-16 21:35:04 -0500: HTTP parse error, malformed request (): #<Puma::HttpParserError: Invalid HTTP format, parsing fails.>

2016-03-16 21:35:04 -0500: ENV: {"rack.version"=>[1, 3], "rack.errors"=>#<IO:<STDERR>>, "rack.multithread"=>true, "rack.multiprocess"=>false, "rack.run_once"=>false, "SCRIPT_NAME"=>"", "QUERY_STRING"=>"", "SERVER_PROTOCOL"=>"HTTP/1.1", "SERVER_SOFTWARE"=>"2.13.4", "GATEWAY_INTERFACE"=>"CGI/1.2"}

2016-03-16 21:35:04 -0500: HTTP parse error, malformed request (): #<Puma::HttpParserError: Invalid HTTP format, parsing fails.>

2016-03-16 21:35:04 -0500: ENV: {"rack.version"=>[1, 3], "rack.errors"=>#<IO:<STDERR>>, "rack.multithread"=>true, "rack.multiprocess"=>false, "rack.run_once"=>false, "SCRIPT_NAME"=>"", "QUERY_STRING"=>"", "SERVER_PROTOCOL"=>"HTTP/1.1", "SERVER_SOFTWARE"=>"2.13.4", "GATEWAY_INTERFACE"=>"CGI/1.2"}

2016-03-16 21:35:04 -0500: HTTP parse error, malformed request (): #<Puma::HttpParserError: Invalid HTTP format, parsing fails.>

2016-03-16 21:35:04 -0500: ENV: {"rack.version"=>[1, 3], "rack.errors"=>#<IO:<STDERR>>, "rack.multithread"=>true, "rack.multiprocess"=>false, "rack.run_once"=>false, "SCRIPT_NAME"=>"", "QUERY_STRING"=>"", "SERVER_PROTOCOL"=>"HTTP/1.1", "SERVER_SOFTWARE"=>"2.13.4", "GATEWAY_INTERFACE"=>"CGI/1.2"}

2016-03-16 21:35:04 -0500: HTTP parse error, malformed request (): #<Puma::HttpParserError: Invalid HTTP format, parsing fails.>

2016-03-16 21:35:04 -0500: ENV: {"rack.version"=>[1, 3], "rack.errors"=>#<IO:<STDERR>>, "rack.multithread"=>true, "rack.multiprocess"=>false, "rack.run_once"=>false, "SCRIPT_NAME"=>"", "QUERY_STRING"=>"", "SERVER_PROTOCOL"=>"HTTP/1.1", "SERVER_SOFTWARE"=>"2.13.4", "GATEWAY_INTERFACE"=>"CGI/1.2"}

2016-03-16 21:35:04 -0500: HTTP parse error, malformed request (): #<Puma::HttpParserError: Invalid HTTP format, parsing fails.>
2016-03-16 21:35:04 -0500: ENV: {"rack.version"=>[1, 3], "rack.errors"=>#<IO:<STDERR>>, "rack.multithread"=>true, "rack.multiprocess"=>false, "rack.run_once"=>fals

This does not say a Hint of what could be
danilogarcia024
@danilogarcia024
MacBook-Pro-de-Danilo:apc-directory danilogarcia024$ rails s puma -e production /Users/danilogarcia024/.rvm/gems/ruby-2.0.0-p643/gems/bundler-1.11.2/lib/bundler.rb:289: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777 /Users/danilogarcia024/.rvm/gems/ruby-2.0.0-p643/gems/bundler-1.11.2/lib/bundler.rb:289: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777 => Booting Puma => Rails 4.1.6 application starting in production on http://0.0.0.0:3000 => Runrails server -h` for more startup options
=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
=> Ctrl-C to shutdown server
Puma 2.13.4 starting...
  • Min threads: 0, max threads: 16
  • Environment: production
  • Listening on tcp://0.0.0.0:3000
    2016-03-16 21:35:04 -0500: HTTP parse error, malformed request (): #<Puma::HttpParserError: Invalid HTTP format, parsing fails.>2016-03-16 21:35:04 -0500: HTTP parse error, malformed request (): #<Puma::HttpParserError: Invalid HTTP format, parsing fails.>
    2016-03-16 21:35:04 -0500: ENV: {"rack.version"=>[1, 3], "rack.errors"=>#<IO:<STDERR>>, "rack.multithread"=>true, "rack.multiprocess"=>false, "rack.run_once"=>false, "SCRIPT_NAME"=>"", "QUERY_STRING"=>"", "SERVER_PROTOCOL"=>"HTTP/1.1", "SERVER_SOFTWARE"=>"2.13.4", "GATEWAY_INTERFACE"=>"CGI/1.2"}
    ---`
Peter Gao
@peteygao

@danilogarcia024 You might want to (in fact, I highly encourage you to) put long stack traces in a gist (https://gist.github.com) and link to it from here.

The warning is definitely something you want to address. You don't want to have your /usr/local/bin directory to be world readable (permission bits 777). The permissions 755 is much more reasonable for that directory (it says only the owner of that directory can write to it, but other users can read and execute binaries from within it). You can change the permissions via sudo chmod -r 755 /usr/local/bin.

Can't help with debugging Invalid HTTP format without knowing what exactly you're sending the server (do you have a sample curl request?)

Tim Abdulla
@timabdulla
it seems that PERSISTENT_TIMEOUT controls the timeout given to persistent connections, but there is no way to easily modify that variable. i need to increase it to match the keep alive timeout on our load balancers. any way to do this without just overriding the constant?
Evan Phoenix
@evanphx
@timabdulla Yes, there isn't a way o change that right now. I'd be happy to merge a PR that adds the ability to control it in the config file though!
@timabdulla i'm interested in why you need to change it though. Why do you need it to be the same as you load balancers?
raelik
@raelik
I could see it being a problem if his load balancers are configured with a longer timeout
Ryan Condron
@rebelweb
Does anyone have any pointers of setting up puma with runit? Thanks for any help that can be given.
Greg Jastrab
@gjastrab
any tips for debugging all my workers logging "! Detected parent died, dying" ?
https://gist.github.com/gjastrab/37d9e6f201be1be2165f65fad5df0182 is my puma config - we do not preload_app! so that we can do phased restarts