Bug 1525302

Summary: Need to explicitly control the number of requests sent to libcurl < 7.30.0
Product: [oVirt] ovirt-engine-sdk-ruby Reporter: Juan Hernández <juan.hernandez>
Component: CoreAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED CURRENTRELEASE QA Contact: Pavel Stehlik <pstehlik>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.1.13CC: bugs, juan.hernandez
Target Milestone: ovirt-4.2.0Flags: rule-engine: ovirt-4.2+
Target Release: 4.2.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 4.2.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-20 13:53:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1513528    

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