Skip to content

Protocol::HTTP::StreamErrors when making PUT requests with cached, persistent connections via Async::HTTP::Faraday::PersistentClients #220

@jakeonfire

Description

@jakeonfire

using async-http-faraday (but i suspect this lib is more relevant), we are seeing a not-insignificant number of Protocol::HTTP::StreamErrors when making a PUT request to the google sheets API (updating a cell in a spreadsheet) when using cached, persistent connections via Async::HTTP::Faraday::PersistentClients. i was wondering if you might have a suggested direction to solve for it. my current thinking is that critical, relatively-infrequent, non-idempotent requests should perhaps use their own non-persistent client. here is the stack trace we are seeing for the error:

Protocol::HTTP2::StreamError: Stream closed! (Protocol::HTTP2::StreamError)
    from async/http/protocol/http2/response.rb:113:in 'wait'
    from async/http/protocol/http2/response.rb:155:in 'wait'
    from async/http/protocol/http2/client.rb:46:in 'read_response'
    from async/http/protocol/http2/client.rb:36:in 'call'
    from protocol/http/request.rb:87:in 'call'
    from async/http/client.rb:143:in 'make_response'
    from async/http/client.rb:101:in 'call'
    from async/http/faraday/adapter.rb:216:in 'block (2 levels) in Async::HTTP::Faraday::Adapter#perform_request'
    from async/http/faraday/adapter.rb:253:in 'block in Async::HTTP::Faraday::Adapter#with_timeout'
    from async/scheduler.rb:631:in 'with_timeout'
    from async/task.rb:153:in 'with_timeout'
    from async/http/faraday/adapter.rb:252:in 'with_timeout'
    from async/http/faraday/adapter.rb:202:in 'block in Async::HTTP::Faraday::Adapter#perform_request'
    from async/http/faraday/adapter.rb:244:in 'block (2 levels) in Async::HTTP::Faraday::Adapter#with_client'
    from async/http/faraday/clients.rb:107:in 'with_client'
    from async/http/faraday/adapter.rb:243:in 'block in Async::HTTP::Faraday::Adapter#with_client'
    from kernel/sync.rb:25:in 'Sync'
    from async/http/faraday/adapter.rb:233:in 'with_client'
    from async/http/faraday/adapter.rb:176:in 'perform_request'
    from async/http/faraday/adapter.rb:167:in 'call'
    from faraday/follow_redirects/middleware.rb:77:in 'perform_with_redirection'
    from faraday/follow_redirects/middleware.rb:65:in 'call'
    from faraday/middleware.rb:56:in 'call'
    from faraday/rack_builder.rb:153:in 'build_response'
    from faraday/connection.rb:452:in 'run_request'
    from faraday/connection.rb:280:in 'put'

async-http-faraday 0.22.1
async-http 0.94.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions