Fix locking issues in Windows

Bug #1153966 reported by Pedro Navarro Pérez
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Pedro Navarro Pérez
OpenStack Compute (nova)
Fix Released
Medium
Pedro Navarro Pérez
oslo-incubator
Fix Released
Medium
Pedro Navarro Pérez
Grizzly
Fix Released
Medium
Pedro Navarro Pérez

Bug Description

When attaching a volume the next error is occurred:

2013-03-11 21:43:29.921 ERROR cinder.openstack.common.rpc.common [req-946e0c80-f48a-431d-8848-997d993f4fce 4353ebfbc4764cd1882c0f336f73ae72 be2150f90f034291b2bbfcd72d7e4884] Returning exception an integer is required to caller
2013-03-11 21:43:29.921 ERROR cinder.openstack.common.rpc.common [req-946e0c80-f48a-431d-8848-997d993f4fce 4353ebfbc4764cd1882c0f336f73ae72 be2150f90f034291b2bbfcd72d7e4884] ['Traceback (most recent call last):\n', ' File "C:\\dev\\openstack\\cinder\\cinder\\openstack\\common\\rpc\\amqp.py", line 430, in _process_data\n rval = self.proxy.dispatch(ctxt, version, method, **args)\n', ' File "C:\\dev\\openstack\\cinder\\cinder\\openstack\\common\\rpc\\dispatcher.py", line 133, in dispatch\n return getattr(proxyobj, method)(ctxt, **kwargs)\n', ' File "C:\\dev\\openstack\\cinder\\cinder\\volume\\manager.py", line 536, in attach_volume\n return do_attach()\n', ' File "C:\\dev\\openstack\\cinder\\cinder\\openstack\\common\\lockutils.py", line 214, in inner\n with lock:\n', ' File "C:\\dev\\openstack\\cinder\\cinder\\openstack\\common\\lockutils.py", line 82, in __enter__\n self.trylock()\n', ' File "C:\\dev\\openstack\\cinder\\cinder\\openstack\\common\\lockutils.py", line 109, in trylock\n msvcrt.locking(self.lockfile, msvcrt.LK_NBLCK, 1)\n', 'TypeError: an integer is required\n']
2013-03-11 21:43:32.229 ERROR cinder.openstack.common.rpc.amqp [req-c4c420ae-df17-4009-aae3-bc6a7e9729b4 4353ebfbc4764cd1882c0f336f73ae72 be2150f90f034291b2bbfcd72d7e4884] Exception during message handling
2013-03-11 21:43:32.229 236 TRACE cinder.openstack.common.rpc.amqp Traceback (most recent call last):
2013-03-11 21:43:32.229 236 TRACE cinder.openstack.common.rpc.amqp File "C:\dev\openstack\cinder\cinder\openstack\common\rpc\amqp.py", line 430, in _process_data
2013-03-11 21:43:32.229 236 TRACE cinder.openstack.common.rpc.amqp rval = self.proxy.dispatch(ctxt, version, method, **args)
2013-03-11 21:43:32.229 236 TRACE cinder.openstack.common.rpc.amqp File "C:\dev\openstack\cinder\cinder\openstack\common\rpc\dispatcher.py", line 133, in dispatch
2013-03-11 21:43:32.229 236 TRACE cinder.openstack.common.rpc.amqp return getattr(proxyobj, method)(ctxt, **kwargs)
2013-03-11 21:43:32.229 236 TRACE cinder.openstack.common.rpc.amqp File "C:\dev\openstack\cinder\cinder\volume\manager.py", line 536, in attach_volume
2013-03-11 21:43:32.229 236 TRACE cinder.openstack.common.rpc.amqp return do_attach()
2013-03-11 21:43:32.229 236 TRACE cinder.openstack.common.rpc.amqp File "C:\dev\openstack\cinder\cinder\openstack\common\lockutils.py", line 214, in inner
2013-03-11 21:43:32.229 236 TRACE cinder.openstack.common.rpc.amqp with lock:
2013-03-11 21:43:32.229 236 TRACE cinder.openstack.common.rpc.amqp File "C:\dev\openstack\cinder\cinder\openstack\common\lockutils.py", line 82, in __enter__
2013-03-11 21:43:32.229 236 TRACE cinder.openstack.common.rpc.amqp self.trylock()
2013-03-11 21:43:32.229 236 TRACE cinder.openstack.common.rpc.amqp File "C:\dev\openstack\cinder\cinder\openstack\common\lockutils.py", line 109, in trylock
2013-03-11 21:43:32.229 236 TRACE cinder.openstack.common.rpc.amqp msvcrt.locking(self.lockfile, msvcrt.LK_NBLCK, 1)
2013-03-11 21:43:32.229 236 TRACE cinder.openstack.common.rpc.amqp TypeError: an integer is required

Tags: drivers
Changed in cinder:
assignee: nobody → Pedro Navarro Pérez (pednape)
tags: added: drivers
Changed in cinder:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/24156

Revision history for this message
Alessandro Pilotti (alexpilotti) wrote : Re: Windows storage server cinder plugin fails when attaching due to lockutils

http://docs.python.org/2/library/msvcrt.html

The docs for msvcrt.locking() say that:

"Lock part of a file based on file descriptor fd from the C runtime."

We need to use fileno() for a file descriptor opened with open()

Changed in oslo:
assignee: nobody → Pedro Navarro Pérez (pednape)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo-incubator (master)

Fix proposed to branch: master
Review: https://review.openstack.org/24162

Changed in oslo:
status: New → In Progress
Mark McLoughlin (markmc)
Changed in oslo:
milestone: none → grizzly-rc1
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo-incubator (master)

Reviewed: https://review.openstack.org/24162
Committed: http://github.com/openstack/oslo-incubator/commit/21925b63af87c36be97eec5b212e06477471bb1e
Submitter: Jenkins
Branch: master

commit 21925b63af87c36be97eec5b212e06477471bb1e
Author: Pedro Navarro Perez <email address hidden>
Date: Tue Mar 12 04:24:51 2013 -0700

    Fix locking issues in Windows

    The Windows Storage Cinder plugin through
    the Windows Locks implementation
    of the InterProcessLock fails in
    attaching/detaching operations.

    Change-Id: I682205592e152b3222e04ca3221d25594d134dd9
    Fixes: bug #1153966

Changed in oslo:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in oslo:
status: Fix Committed → Fix Released
Revision history for this message
Thierry Carrez (ttx) wrote : Re: Windows storage server cinder plugin fails when attaching due to lockutils
Changed in nova:
importance: Undecided → Medium
milestone: none → grizzly-rc2
status: New → Fix Released
summary: - Windows storage server cinder plugin fails when attaching due to
- lockutils
+ Fix locking issues in Windows
Changed in nova:
status: Fix Released → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Changed in nova:
assignee: nobody → Pedro Navarro Pérez (pednape)
Changed in cinder:
status: In Progress → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: grizzly-rc2 → 2013.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.