summaryrefslogtreecommitdiff
path: root/db/instance.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'db/instance.cpp')
-rw-r--r--db/instance.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/db/instance.cpp b/db/instance.cpp
index 9e81464..a6873f2 100644
--- a/db/instance.cpp
+++ b/db/instance.cpp
@@ -499,6 +499,7 @@ namespace mongo {
if( ntoreturn )
ss << " ntoreturn:" << ntoreturn;
+ time_t start = 0;
int pass = 0;
bool exhaust = false;
QueryResult* msgdata;
@@ -511,6 +512,17 @@ namespace mongo {
catch ( GetMoreWaitException& ) {
exhaust = false;
massert(13073, "shutting down", !inShutdown() );
+ if( pass == 0 ) {
+ start = time(0);
+ }
+ else {
+ if( time(0) - start >= 4 ) {
+ // after about 4 seconds, return. this is a sanity check. pass stops at 1000 normally
+ // for DEV this helps and also if sleep is highly inaccurate on a platform. we want to
+ // return occasionally so slave can checkpoint.
+ pass = 10000;
+ }
+ }
pass++;
DEV
sleepmillis(20);