From f1cd4e99c2194bb9bc26919590813acfebfb321b Mon Sep 17 00:00:00 2001 From: Kristina Date: Thu, 14 Jul 2011 15:44:34 -0400 Subject: [PATCH] return 0 instead of throwing getMoreWaitException --- db/instance.cpp | 14 +++++++------- db/ops/query.cpp | 2 +- db/ops/query.h | 3 --- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/db/instance.cpp b/db/instance.cpp index 042748b795f..ede433d652b 100644 --- a/db/instance.cpp +++ b/db/instance.cpp @@ -526,7 +526,13 @@ namespace mongo { Client::Context ctx(ns); msgdata = processGetMore(ns, ntoreturn, cursorid, curop, pass, exhaust); } - catch ( GetMoreWaitException& ) { + catch ( AssertionException& e ) { + exhaust = false; + curop.debug().exceptionInfo = e.getInfo(); + msgdata = emptyMoreResult(cursorid); + ok = false; + } + if (msgdata == 0) { exhaust = false; massert(13073, "shutting down", !inShutdown() ); if( pass == 0 ) { @@ -547,12 +553,6 @@ namespace mongo { sleepmillis(2); continue; } - catch ( AssertionException& e ) { - exhaust = false; - curop.debug().exceptionInfo = e.getInfo(); - msgdata = emptyMoreResult(cursorid); - ok = false; - } break; }; diff --git a/db/ops/query.cpp b/db/ops/query.cpp index d4f43d791db..120382fa7d8 100644 --- a/db/ops/query.cpp +++ b/db/ops/query.cpp @@ -145,7 +145,7 @@ namespace mongo { continue; if( n == 0 && (queryOptions & QueryOption_AwaitData) && pass < 1000 ) { - throw GetMoreWaitException(); + return 0; } break; diff --git a/db/ops/query.h b/db/ops/query.h index 5e008c89731..ada2e90c3bd 100644 --- a/db/ops/query.h +++ b/db/ops/query.h @@ -32,9 +32,6 @@ namespace mongo { extern const int MaxBytesToReturnToClientAtOnce; - // for an existing query (ie a ClientCursor), send back additional information. - struct GetMoreWaitException { }; - QueryResult* processGetMore(const char *ns, int ntoreturn, long long cursorid , CurOp& op, int pass, bool& exhaust); long long runCount(const char *ns, const BSONObj& cmd, string& err);