summaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authorSusan LoVerso <sue@wiredtiger.com>2014-04-22 19:50:19 -0400
committerSusan LoVerso <sue@wiredtiger.com>2014-04-22 19:50:19 -0400
commit1d079a8d3640a453b85ff1077c9fba85bd728202 (patch)
treee3714b1c65fa5f8c9b62466d468eff5a7008bac4 /lang
parent76d86325a0b5c3afbabc3425b3edab1578f079ea (diff)
downloadmongo-1d079a8d3640a453b85ff1077c9fba85bd728202.tar.gz
Add ENOMEM_OK for async_new_op.
Diffstat (limited to 'lang')
-rw-r--r--lang/python/wiredtiger.i15
1 files changed, 15 insertions, 0 deletions
diff --git a/lang/python/wiredtiger.i b/lang/python/wiredtiger.i
index ff27e69fdd4..0d9d279fc5d 100644
--- a/lang/python/wiredtiger.i
+++ b/lang/python/wiredtiger.i
@@ -307,6 +307,20 @@ do {
SWIG_ERROR_IF_NOT_SET(result);
}
+/* Async operations can return ENOMEM when no ops are available. */
+%define ENOMEM_OK(m)
+%exception m {
+retry:
+ $action
+ if (result != 0 && result != ENOMEM)
+ SWIG_ERROR_IF_NOT_SET(result);
+ else if (result == ENOMEM) {
+ sleep(10000);
+ goto retry;
+ }
+}
+%enddef
+
/* Cursor positioning methods can also return WT_NOTFOUND. */
%define NOTFOUND_OK(m)
%exception m {
@@ -325,6 +339,7 @@ do {
}
%enddef
+ENOMEM_OK(__wt_connection::async_new_op)
NOTFOUND_OK(__wt_cursor::next)
NOTFOUND_OK(__wt_cursor::prev)
NOTFOUND_OK(__wt_cursor::remove)