← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1677047] Re: glance download fsync raises EINVAL for FIFOs

 

Reviewed:  https://review.openstack.org/451094
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=641798f75f50e7b4db3c7a8ccefcb8b590228893
Submitter: Jenkins
Branch:    master

commit 641798f75f50e7b4db3c7a8ccefcb8b590228893
Author: Eric Fried <efried@xxxxxxxxxx>
Date:   Tue Mar 28 17:13:09 2017 -0500

    Glance download: only fsync files
    
    Recent changes [1][2] added fsync to the data file in
    GlanceImageServiceV2.download.  This raises EINVAL if the file is a
    pipe/FIFO or socket [3].
    
    This change set adds a static _safe_fsync method to GlanceImageServiceV2
    which conditions the fsync call not to run if the file handle represents
    a pipe/FIFO or socket, and uses that call from the download method.
    
    [1] https://review.openstack.org/#/c/441246/
    [2] https://review.openstack.org/#/c/443583/
    [3] http://man7.org/linux/man-pages/man2/fsync.2.html#ERRORS
    
    Change-Id: Ied5788deadcf3d1336a48288cf49d8571db23659
    Closes-Bug: #1677047


** Changed in: nova
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1677047

Title:
  glance download fsync raises EINVAL for FIFOs

Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  Description
  ===========
  The nova.image.glance.GlanceImageServiceV2.download method recently added fsync [1][2] before closing the download file.

  Some hypervisors don't use regular files for download.  For example,
  PowerVM uses a FIFO pipe, the other end of which is read by a service
  that offloads the image data to a remote node.

  fsync on a pipe, FIFO, or socket errors with EINVAL [3].

  [1] https://review.openstack.org/#/c/441246/
  [2] https://review.openstack.org/#/c/443583/
  [3] http://man7.org/linux/man-pages/man2/fsync.2.html#ERRORS

  Steps to reproduce
  ==================
  Invoke nova.image.glance.GlanceImageServiceV2.download with data=None, dst_path=path where path represents a FIFO or socket.

  Expected result
  ===============
  Successful transfer of data through the FIFO/socket.

  Actual result
  =============
  An exception similar to the following:

    File "/usr/local/lib/python2.7/dist-packages/pypowervm/internal_utils/thread_utils.py", line 34, in future_func
      return func(*args, **kwargs)
    File "/opt/stack/nova/nova/virt/powervm/disk/ssp.py", line 161, in upload
      IMAGE_API.download(context, image_meta.id, dest_path=path)
    File "/opt/stack/nova/nova/image/api.py", line 184, in download
      dst_path=dest_path)
    File "/opt/stack/nova/nova/image/glance.py", line 387, in download
      os.fsync(data.fileno())
  OSError: [Errno 22] Invalid argument

  Immutable reference to the offending fsync call:
  https://github.com/openstack/nova/blob/640b152004fe3d9c43c26538809c3ac796f20eba/nova/image/glance.py#L375

  Environment
  ===========
  devstack, pike, with the nova tree at this in-flight patch set: https://review.openstack.org/#/c/443189/15

  Ubuntu 16.04.1 LTS running on PowerVM NovaLink, using Shared Storage
  Pools through a single VIOS.

  No networking.

  Logs & Configs
  ==============
  Available on request if needed.  This is a snap to reproduce.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1677047/+subscriptions


References