-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PYCBC-446: Gracefully fail on signal receipt
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]>
- Loading branch information
Showing
5 changed files
with
25 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters