-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multipart post causes error in protocol-http #32
Comments
verified this issue exists with conn = Faraday.new do |c|
c.request :multipart
c.adapter :async_http
end
task = Async do
conn.post("https://httpbin.org/post") do |req|
req.body = { "file" => Faraday::Multipart::FilePart.new(StringIO.new("file content"), "text/plain", "file.txt") }
end
end
task.wait |
separately, my app memory is now running amuck. i'm using you can see me using fewer and fewer |
That does look like a memory leak. Are you able to share more details of the app? I have a memory profiling tool, would you be willing to capture a dump? |
more details, hmm... the app (rails 7.1) accepts requests from a client (another app of ours), proxies them (in the loosest sense) to various 3rd party APIs (on a couple dozen different hosts), then formats the response back to the client. we are using i would be willing to capture a dump and private-gist it to you. also sorry to hijack my own thread, but just want to make sure you saw my first two messages were about a separate (non-memory) issue. |
imagine a vanilla rails app, where controller actions might look like: class SomeController < ApplicationController
def update
response = request_handler.do_post("https://microsoft.com/update_thing", params[:post_body])
render json: response.body
end
def request_handler
@_request_handler ||= RequestHandler.new
end
end and class RequestHandler
def do_post(url, body)
task = Async do
conn.post(url) do |req|
req.body = body
end
end
response = task.wait
end
def conn
Faraday.new do |c|
c.adapter :async_http
end
end
end the app is using |
and fwiw i've tried with both |
I can reproduce the original issue, so let me fix that to start with. |
This is fixed in v0.13.0 of Can you try it out and let me know? |
yep, it works 🥳 i didn't realize you also work on |
when making a multipart post request the following error occurs:
gems used:
async-http-faraday (0.12.0)
faraday (0.17.6)
code to reproduce:
The text was updated successfully, but these errors were encountered: