Bug 1525302 - Need to explicitly control the number of requests sent to libcurl < 7.30.0
Summary: Need to explicitly control the number of requests sent to libcurl < 7.30.0
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine-sdk-ruby
Classification: oVirt
Component: Core
Version: 4.1.13
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ovirt-4.2.0
: 4.2.1
Assignee: Juan Hernández
QA Contact: Pavel Stehlik
URL:
Whiteboard:
Depends On:
Blocks: 1513528
TreeView+ depends on / blocked
 
Reported: 2017-12-13 02:00 UTC by Juan Hernández
Modified: 2017-12-20 13:53 UTC (History)
2 users (show)

Fixed In Version: 4.2.1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-12-20 13:53:06 UTC
oVirt Team: Infra
Embargoed:
rule-engine: ovirt-4.2+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 85352 0 master MERGED Limit the number of requests sent to libcurl 2017-12-13 15:18:58 UTC

Description Juan Hernández 2017-12-13 02:00:43 UTC
Description of problem:

The SDK tries to control the number of connections and the pipeline length using the corresponding libcurl optoins. But these options are new in version 7.30.0, which isn't available in CentOS or RHEL 7.

The result is that programs that use the asynchronous request mechanism and that don't control explicitly and carefully the number of requests sent to the SDK may end up creating too many connections, to the point where the oVirt server can't process them, resulting in errors like this:

  Can't send request: SSL connect error

Version-Release number of selected component (if applicable):

CentOS 7 or RHEL 7, with libcurl < 7.30.0.

How reproducible:

Always.

Steps to Reproduce:

1. Create a script that sends many asynchronous requests without control, like this:

---8<---
require 'logger'
require 'ovirtsdk4'

# Create the connection:
connection = OvirtSDK4::Connection.new(
  url: 'https://.../ovirt-engine/api',
  username: '...@internal',
  password: '...',
  ca_file: 'ca.pem',
  debug: true,
  log: Logger.new('example.log'),
  connections: 10,
  pipeline: 10
)

# Find the first data center:
system_service = connection.system_service
dcs_service = system_service.data_centers_service
dc = dcs_service.list.first
dc_service = dcs_service.data_center_service(dc.id)

# Send 1000 requests to retrieve the data center:
futures = []
1000.times do |i|
  puts("send #{i}")
  future = dc_service.get(wait: false)
  futures << future
end

# Wait for the responses:
i = 0
futures.each do |future|
  puts("wait #{i}")
  dc = future.wait
  i += 1
end

# Close the connection:
connection.close
--->8---

2. Run the script:

  $ ruby test.rb

Actual results:

After some time running, an exception with the following error message is generated:

   Can't send request: SSL connect error

Expected results:

The script should finish without errors.

Comment 1 Sandro Bonazzola 2017-12-20 13:38:55 UTC
Looks like this bug is referenced in oVirt 4.2.0 GA content, can you please crosscheck if it has been released?

Comment 2 Juan Hernández 2017-12-20 13:53:06 UTC
Yes, it has been released, the RPM is available here:

  http://resources.ovirt.org/pub/ovirt-4.2/rpm/el7/x86_64/rubygem-ovirt-engine-sdk4-4.2.1-1.el7.centos.x86_64.rpm


Note You need to log in before you can comment on or make changes to this bug.