ovis-hpc / sos

sos pre-release stable.
https://github.com/ovis-hpc/sos/wiki
Other
4 stars 7 forks source link

Fix dsos_transaction_begin() to honor `timeout` #92

Closed narategithub closed 11 months ago

narategithub commented 1 year ago

dsos_transaction_begin() should be a 'blocking' call if the timeout argument is NULL, or a timed-wait call if timeout parameter is given.

REMARK: The 'nogil' patch in the Cython code is to release the Python's Global Interpreter Lock (GIL) before we call (with a chance of blocking) the dsos transaction functions. Otherwise, other Python's threads could not proceed since the blocking-caller was also holding the GIL.

tom95858 commented 1 year ago

@narategithub What symptom does this specifically fix? When the timeout is NULL? Is there some other race this addresses?

narategithub commented 1 year ago

@tom95858 The issue before this patch was the timeout wasn't used at all. The function always return either 0 or EBUSY right away. This patch made it a blocking call if timeout is NULL, and condition-wait for a specific time if timeout is given as described in the existing document of the function.