untagged-bcbc184c3de3a65f9ea7: PYCBC-446: Gracefully fail on signal receipt
griels
released this
23 Aug 10:58
Motivation
----------
If the Python process is interrupted by a signal,
lcb_wait3 may return before all remaining jobs
have completed/timed out. This can lead to an exception
being thrown after the wait, as normally
this would only return after this point.
We should gracefully handle this scenario.
Changes
-------
Add a field 'check_type' to the Bucket class.
Instead of using pycbc_assert to raise an abort() if there are
remaining operations to complete after lcb_wait has
returned, according to the check_type value, do the following:
PYCBC_CHECK_NONE: don't raise an exception.
PYCBC_CHECK_STRICT: (the default): raise an SDKInternalError
PYCBC_CHECK_FAIL: (for testing): always fail and raise an exception
Results
-------
It is difficult to automatically reproduce this, but as
we are now raising a Python exception rather than an abort(),
as verified by the tests, the end user should be able
to handle this by catching the exception if necessary. Or
they can turn off checking by setting the flag to
PYCBC_CHECK_NONE.
Change-Id: I5497267ba58496c57fe03b040fbc4eeb67fb16bd
Reviewed-on: http://review.couchbase.org/112725
Tested-by: Ellis Breen <[email protected]>
Reviewed-by: Brett Lawson <[email protected]>
Reviewed-by: Sergey Avseyev <[email protected]>
Tested-by: Build Bot <[email protected]>