diff options
author | Eliot Horowitz <eliot@10gen.com> | 2014-12-15 09:42:38 -0500 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2014-12-16 12:14:13 -0500 |
commit | 50745fafe0084ae35f68b69aff62e3ef5895fc30 (patch) | |
tree | a7dab0a89471647c975e386b1f66c41ccbfdf73f /src/mongo/db/concurrency/write_conflict_exception.cpp | |
parent | 4c35dddf0fa0aca41436c100a0d7dadb495c2174 (diff) | |
download | mongo-50745fafe0084ae35f68b69aff62e3ef5895fc30.tar.gz |
SERVER-16519: turn on printing write conflict traces via setParameter
Diffstat (limited to 'src/mongo/db/concurrency/write_conflict_exception.cpp')
-rw-r--r-- | src/mongo/db/concurrency/write_conflict_exception.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mongo/db/concurrency/write_conflict_exception.cpp b/src/mongo/db/concurrency/write_conflict_exception.cpp index 7870a721056..7e6e9d08c75 100644 --- a/src/mongo/db/concurrency/write_conflict_exception.cpp +++ b/src/mongo/db/concurrency/write_conflict_exception.cpp @@ -32,9 +32,21 @@ #include "mongo/db/concurrency/write_conflict_exception.h" #include "mongo/util/log.h" +#include "mongo/util/stacktrace.h" namespace mongo { + bool WriteConflictException::trace = false; + + WriteConflictException::WriteConflictException() + : DBException( "WriteConflict", ErrorCodes::WriteConflict ) { + + if ( trace ) { + printStackTrace(); + } + + } + void WriteConflictException::logAndBackoff(int attempt, const StringData& operation, const StringData& ns) { |