Skip to content

Instantly share code, notes, and snippets.

@leifwalsh
Created July 27, 2013 16:13
Show Gist options
  • Save leifwalsh/6095309 to your computer and use it in GitHub Desktop.
Save leifwalsh/6095309 to your computer and use it in GitHub Desktop.
add stacktrace to RetryableException constructor to track down an auth issue
diff --git a/src/mongo/db/storage/env.cpp b/src/mongo/db/storage/env.cpp
index 3010888..9682308 100644
--- a/src/mongo/db/storage/env.cpp
+++ b/src/mongo/db/storage/env.cpp
@@ -45,6 +45,8 @@ namespace mongo {
namespace storage {
+ SimpleMutex RetryableException::_m("RetryableException");
+
DB_ENV *env;
static int dbt_key_compare(DB *db, const DBT *dbt1, const DBT *dbt2) {
diff --git a/src/mongo/db/storage/exception.h b/src/mongo/db/storage/exception.h
index 6a4ac51..23ca63d 100644
--- a/src/mongo/db/storage/exception.h
+++ b/src/mongo/db/storage/exception.h
@@ -24,6 +24,10 @@
#include "mongo/util/assert_util.h"
#include "mongo/util/mongoutils/str.h"
+#include "mongo/util/log.h"
+#include "mongo/util/stacktrace.h"
+#include "mongo/util/concurrency/mutex.h"
+
namespace mongo {
namespace storage {
@@ -85,8 +89,9 @@ namespace mongo {
};
class RetryableException : public UserException {
+ static SimpleMutex _m;
public:
- RetryableException(int code, const std::string &msg) : UserException(code, msg) {}
+ RetryableException(int code, const std::string &msg) : UserException(code, msg) { SimpleMutex::scoped_lock lk(_m); LOG(0) << "throwing retryable exception" << endl; printStackTrace(); }
virtual ~RetryableException() throw() {}
class MvccDictionaryTooNew;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment