Permalink
Switch branches/tags
Commits on Feb 13, 2013
  1. Note that responses are returned in-order

    drbrain committed Feb 13, 2013
    The documentation didn't clearly explain that pipelined HTTP requests
    are returned in-order.  This is a slight improvement, but sample/ really
    needs a full-up WEBrick example.
    
    See also #3
Commits on May 24, 2012
  1. Fix typo

    drbrain committed May 24, 2012
Commits on Apr 13, 2012
  1. Bumped version

    drbrain committed Apr 13, 2012
  2. Added test for @22005b9

    drbrain committed Apr 13, 2012
  3. retry on request limits for persistent connections

    Eric Wong committed with drbrain Dec 19, 2011
    nginx has a keepalive_requests directive that limits the
    number of requests a client may make over a single keepalive
    connection.  By default, this limit is 100 requests.
    
    With the test script below, I get IOError on the 101st request
    when hitting bogomips.org (my server).
    
    $prefix/lib/ruby/1.9.1/net/protocol.rb:141:in `read_nonblock': closed stream (IOError)
    	from $prefix/lib/ruby/1.9.1/net/protocol.rb:141:in `rbuf_fill'
    	from $prefix/lib/ruby/1.9.1/net/protocol.rb:122:in `readuntil'
    	from $prefix/lib/ruby/1.9.1/net/protocol.rb:132:in `readline'
    	from $prefix/lib/ruby/1.9.1/net/http.rb:2562:in `read_status_line'
    	from $prefix/lib/ruby/1.9.1/net/http.rb:2551:in `read_new'
    	from $prefix/lib/ruby/gems/1.9.1/gems/net-http-pipeline-1.0/lib/net/http/pipeline.rb:298:in `pipeline_receive'
    	from $prefix/lib/ruby/gems/1.9.1/gems/net-http-pipeline-1.0/lib/net/http/pipeline.rb:179:in `pipeline'
    	from $prefix/lib/ruby/gems/1.9.1/gems/net-http-persistent-2.3.2/lib/net/http/persistent.rb:543:in `pipeline'
    	from t.rb:21:in `block in <main>'
    	from t.rb:19:in `times'
    	from t.rb:19:in `<main>'
    
    Ideally, Ruby could avoid raising IOError by not reading a
    closed stream, but I don't have time to dig into net/http
    internals so rescuing on IOError and retrying is easier.
    
    Feel free to hit bogomips.org with the following test script
    to confirm/test/debug this issue:
    
      # tested with ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]
      require 'net/http/pipeline'
      require 'net/http/persistent' # tested with 2.3.2
      require 'uri'
    
      nr = (ARGV.shift || 101).to_i
      np = (ARGV.shift || 1).to_i
      puts "requests per pipeline call: #{nr}"
      puts "pipeline calls: #{np}"
    
      # bogomips.org runs nginx with the default
      # keepalive_requests=100 directive
      # Apache servers have a similar MaxKeepaliveRequests directive
      # https://httpd.apache.org/docs/2.2/mod/core.html#maxkeepaliverequests
      uri = URI('http://bogomips.org/')
      http = Net::HTTP::Persistent.new('x')
      requests = nr.times.map { Net::HTTP::Get.new(uri.path) }
    
      # if nr is > keepalive_requests value on the server,
      # IOError gets raised
      np.times do |j|
        i = -1
        http.pipeline(uri, requests.dup) do |resp|
          p [ j, i += 1,  resp ]
        end
      end
  4. Use hoe-travis plugin

    drbrain committed Apr 13, 2012
Commits on Sep 26, 2011
  1. Make the sample work and update it with documentation about how net-h…

    drbrain committed Sep 26, 2011
    …ttp-pipeline works. Issue #1
Commits on Mar 29, 2011
  1. Fix documentation URL

    drbrain committed Mar 29, 2011
  2. Also push doc to rubyforge

    drbrain committed Mar 29, 2011
  3. Fix README

    drbrain committed Mar 29, 2011
  4. Handle bad request

    drbrain committed Mar 29, 2011
  5. Add doc location

    drbrain committed Mar 29, 2011
Commits on Jan 27, 2011
  1. Cleanup test

    drbrain committed Jan 27, 2011
  2. Only retry idempotent requests

    drbrain committed Jan 27, 2011
  3. Enusre we give up at some point

    drbrain committed Jan 27, 2011
  4. Retry requests on failure

    drbrain committed Jan 27, 2011
Commits on Jan 26, 2011
  1. Test block handling

    drbrain committed Jan 26, 2011
  2. Test pipeline_receive

    drbrain committed Jan 26, 2011
  3. Update comment

    drbrain committed Jan 26, 2011
Commits on Dec 8, 2010
  1. Add #pipeline= to override first-request check, only perform first-ti…

    drbrain committed Dec 8, 2010
    …me checks inside first-time check block
  2. Use minitest

    drbrain committed Dec 8, 2010