Skip to content
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

type=STREAM on each request, leads to a "too many open files" error #682

Open
imtiazwazir opened this issue Sep 23, 2021 · 0 comments
Open

Comments

@imtiazwazir
Copy link

By running the following code Typheous generates STREAM files and does not shut them which leads to error.

request = Typhoeus::Request.new(url, options)
request.on_complete do |response|
  if response.success?
    response = request.response
    return {
      time: response.total_time,
      code: response.code,
      header: response.headers,
      body: current_response(response.body, response_type)
    }
  elsif response.timed_out?
    raise StandardError, "Got a time out"
  elsif response.code.zero?
    raise StandardError, response.return_message
  else
    raise StandardError, "HTTP request failed: #{response.code}"
  end
end

request.run        
OS: Ubuntu 20.04.3
Ruby: 3.0.2
Typhoeus: 1.4.0

What kind of stream?
lsof command shown many following type of files.
bundle 193462 ubuntu 1093u unix 0x0000000000000000 0t0 1654378 type=STREAM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant