Bug 1509910 - Don't send `Expect: 100-Continue` for PUT requests
Summary: Don't send `Expect: 100-Continue` for PUT requests
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine-sdk-ruby
Classification: oVirt
Component: Core
Version: 4.1.10
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ovirt-4.1.8
: 4.1.11
Assignee: Juan Hernández
QA Contact: Radim Hrazdil
URL:
Whiteboard:
Depends On:
Blocks: 1510459
TreeView+ depends on / blocked
 
Reported: 2017-11-06 10:23 UTC by Juan Hernández
Modified: 2017-12-11 16:28 UTC (History)
2 users (show)

Fixed In Version: 4.1.11
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-12-11 16:28:56 UTC
oVirt Team: Infra
Embargoed:
rule-engine: ovirt-4.1+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 83595 0 master MERGED Don't send 'Expect: 100-continue' 2017-11-06 10:40:29 UTC
oVirt gerrit 83630 0 sdk_4.1 MERGED Don't send 'Expect: 100-continue' 2017-11-06 10:53:48 UTC

Description Juan Hernández 2017-11-06 10:23:06 UTC
Currently the SDK sends the `Expect: 100-continue` for PUT requests, and then waits up to 1 second to receive the response from the server. But the oVirt server doesn't support this mechanism. The net result is that every PUT request is artificially delayed one second. The SDK should not use this mechanism.

Comment 1 Juan Hernández 2017-11-28 17:11:00 UTC
To verify create a script that performs an update and measure how long it takes:

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

# Create the connection to the server:
connection = OvirtSDK4::Connection.new(
  url: 'https://engine42.local/ovirt-engine/api',
  username: 'admin@internal',
  password: 'redhat123',
  insecure: true,
  debug: true,
  log: Logger.new('test.log')
)

# Find the data service:
dcs_service = connection.system_service.data_centers_service
dc = dcs_service.list(search: 'name=mydc').first
dc_service = dcs_service.data_center_service(dc.id)

# Measure how long it takes to update the data center:
before = Time.now
dc = dc_service.update(description: 'Updated description')
after = Time.now
elapsed = after - before
puts("#{elapsed}s")

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

Execute that script, it should print the time it took to do the update, and it should be less than one second.

In addition the generated `test.log` file should *not* contain this line:

  D, [2017-11-28T18:09:57.011331 #11968] DEBUG -- : Expect: 100-continue

Comment 2 Radim Hrazdil 2017-11-28 21:54:20 UTC
Verified that script suggested by Juan finishes in less than one second. Created log does not contain "DEBUG -- : Expect: 100-continue". 
SDK version 4.2.0.beta2, RHVM 4.1.8.1.


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