#3 Python 3.7 cannot use arg `async`
Closed 4 years ago by nsoffer. Opened 5 years ago by danken.

async has become a reserved word. I suggest that sanlock starts supporting async_ arg as well, as does ovirtsdk4 https://gerrit.ovirt.org/gitweb?p=ovirt-engine-sdk.git;a=commitdiff;h=7f75f4786c82b3df192257a6c14a19a7dfc1c527


Metadata Update from @nsoffer:
- Issue assigned to nsoffer

4 years ago

In sanlock 3.8, first version supporting python 3, async=False will be replace by wait=True.
The python 2 version will support both async and wait flags for backward compatibility.

In python 2 and python 3 we will support:
- wait=True
- wait=False

In python 2 we will allow also:
- async=True
- async=False

If both async= and wait= arguments are specified, raise RuntimeError.

@nsoffer
Maybe we should use the term "block" instead of "wait", then block = True would be like async = False, but the intention is more clear IMO.

sanlock already chose wait=, for example:

inq_lockspace(lockspace, host_id, path, offset=0, wait=False)

Vdsm went with wait= as replacement for async. The concept of wait is very popular in the standard library, and its more general and clear.

github patches, i believe resolution there eliminates the need to check for coexistance of "wait" and "async" in Py2:
https://github.com/nirs/sanlock/pull/14/commits/83bc4e375db06b383c8fab7d5977b7631fc37310
https://github.com/nirs/sanlock/pull/14/commits/e7230b58a8d5f379b891788255231167b2d28442

This was resolved in sanlock 3.8/0.

Metadata Update from @nsoffer:
- Issue status updated to: Closed (was: Open)

4 years ago

Login to comment on this ticket.

Metadata