summaryrefslogtreecommitdiff
path: root/src/mongo/db/free_mon
diff options
context:
space:
mode:
authorclang-format-7.0.1 <adam.martin@10gen.com>2019-07-26 18:20:35 -0400
committerADAM David Alan Martin <adam.martin@10gen.com>2019-07-27 11:02:23 -0400
commit134a4083953270e8a11430395357fb70a29047ad (patch)
treedd428e1230e31d92b20b393dfdc17ffe7fa79cb6 /src/mongo/db/free_mon
parent1e46b5049003f427047e723ea5fab15b5a9253ca (diff)
downloadmongo-134a4083953270e8a11430395357fb70a29047ad.tar.gz
SERVER-41772 Apply clang-format 7.0.1 to the codebase
Diffstat (limited to 'src/mongo/db/free_mon')
-rw-r--r--src/mongo/db/free_mon/free_mon_controller.h32
-rw-r--r--src/mongo/db/free_mon/free_mon_controller_test.cpp201
-rw-r--r--src/mongo/db/free_mon/free_mon_message.h24
-rw-r--r--src/mongo/db/free_mon/free_mon_mongod.cpp31
-rw-r--r--src/mongo/db/free_mon/free_mon_op_observer.cpp5
-rw-r--r--src/mongo/db/free_mon/free_mon_options.h4
-rw-r--r--src/mongo/db/free_mon/free_mon_processor.cpp60
-rw-r--r--src/mongo/db/free_mon/free_mon_queue_test.cpp2
8 files changed, 139 insertions, 220 deletions
diff --git a/src/mongo/db/free_mon/free_mon_controller.h b/src/mongo/db/free_mon/free_mon_controller.h
index 92e1edab444..9307ab7570c 100644
--- a/src/mongo/db/free_mon/free_mon_controller.h
+++ b/src/mongo/db/free_mon/free_mon_controller.h
@@ -157,33 +157,33 @@ private:
private:
/**
- * Private enum to track state.
- *
- * +-----------------------------------------------------------+
- * | v
- * +-------------+ +----------+ +----------------+ +-------+
- * | kNotStarted | --> | kStarted | --> | kStopRequested | --> | kDone |
- * +-------------+ +----------+ +----------------+ +-------+
- */
+ * Private enum to track state.
+ *
+ * +-----------------------------------------------------------+
+ * | v
+ * +-------------+ +----------+ +----------------+ +-------+
+ * | kNotStarted | --> | kStarted | --> | kStopRequested | --> | kDone |
+ * +-------------+ +----------+ +----------------+ +-------+
+ */
enum class State {
/**
- * Initial state. Either start() or stop() can be called next.
- */
+ * Initial state. Either start() or stop() can be called next.
+ */
kNotStarted,
/**
- * start() has been called. stop() should be called next.
- */
+ * start() has been called. stop() should be called next.
+ */
kStarted,
/**
- * stop() has been called, and the background thread is in progress of shutting down
- */
+ * stop() has been called, and the background thread is in progress of shutting down
+ */
kStopRequested,
/**
- * Controller has been stopped.
- */
+ * Controller has been stopped.
+ */
kDone,
};
diff --git a/src/mongo/db/free_mon/free_mon_controller_test.cpp b/src/mongo/db/free_mon/free_mon_controller_test.cpp
index 0ad7a139dc6..090eed90cc9 100644
--- a/src/mongo/db/free_mon/free_mon_controller_test.cpp
+++ b/src/mongo/db/free_mon/free_mon_controller_test.cpp
@@ -44,7 +44,6 @@
#include "mongo/base/deinitializer_context.h"
#include "mongo/bson/bson_validate.h"
#include "mongo/bson/bsonmisc.h"
-#include "mongo/bson/bsonmisc.h"
#include "mongo/bson/bsonobjbuilder.h"
#include "mongo/db/client.h"
#include "mongo/db/free_mon/free_mon_op_observer.h"
@@ -119,8 +118,8 @@ public:
private:
/**
- * Private enum to ensure caller uses class correctly.
- */
+ * Private enum to ensure caller uses class correctly.
+ */
enum class State {
kNotStarted,
kStarted,
@@ -248,10 +247,9 @@ public:
if (_options.doSync) {
pf.promise.setFrom(doRegister(req));
} else {
- auto swSchedule =
- _threadPool->scheduleWork([ sharedPromise = std::move(pf.promise), req, this ](
+ auto swSchedule = _threadPool->scheduleWork(
+ [sharedPromise = std::move(pf.promise), req, this](
const executor::TaskExecutor::CallbackArgs& cbArgs) mutable {
-
sharedPromise.setWith([&] { return doRegister(req); });
});
@@ -295,10 +293,9 @@ public:
if (_options.doSync) {
pf.promise.setFrom(doMetrics(req));
} else {
- auto swSchedule =
- _threadPool->scheduleWork([ sharedPromise = std::move(pf.promise), req, this ](
+ auto swSchedule = _threadPool->scheduleWork(
+ [sharedPromise = std::move(pf.promise), req, this](
const executor::TaskExecutor::CallbackArgs& cbArgs) mutable {
-
sharedPromise.setWith([&] { return doMetrics(req); });
});
@@ -543,8 +540,7 @@ TEST(FreeMonProcessorTest, TestRegistrationResponseValidation) {
<< "http://www.example.com/123"
<< "message"
<< "msg456"
- << "reportingInterval"
- << 1LL))));
+ << "reportingInterval" << 1LL))));
// max reporting interval
ASSERT_OK(FreeMonProcessor::validateRegistrationResponse(FreeMonRegistrationResponse::parse(
@@ -555,8 +551,7 @@ TEST(FreeMonProcessorTest, TestRegistrationResponseValidation) {
<< "http://www.example.com/123"
<< "message"
<< "msg456"
- << "reportingInterval"
- << 30 * 60 * 60 * 24LL))));
+ << "reportingInterval" << 30 * 60 * 60 * 24LL))));
// Positive: version 2
ASSERT_OK(FreeMonProcessor::validateRegistrationResponse(FreeMonRegistrationResponse::parse(
@@ -567,8 +562,7 @@ TEST(FreeMonProcessorTest, TestRegistrationResponseValidation) {
<< "http://www.example.com/123"
<< "message"
<< "msg456"
- << "reportingInterval"
- << 1LL))));
+ << "reportingInterval" << 1LL))));
// Positive: empty registration id string
ASSERT_OK(FreeMonProcessor::validateRegistrationResponse(FreeMonRegistrationResponse::parse(
@@ -579,8 +573,7 @@ TEST(FreeMonProcessorTest, TestRegistrationResponseValidation) {
<< "http://www.example.com/123"
<< "message"
<< "msg456"
- << "reportingInterval"
- << 1LL))));
+ << "reportingInterval" << 1LL))));
// Negative: bad protocol version
ASSERT_NOT_OK(FreeMonProcessor::validateRegistrationResponse(FreeMonRegistrationResponse::parse(
@@ -591,8 +584,7 @@ TEST(FreeMonProcessorTest, TestRegistrationResponseValidation) {
<< "http://www.example.com/123"
<< "message"
<< "msg456"
- << "reportingInterval"
- << 1LL))));
+ << "reportingInterval" << 1LL))));
// Negative: halt uploading
ASSERT_NOT_OK(FreeMonProcessor::validateRegistrationResponse(FreeMonRegistrationResponse::parse(
@@ -603,8 +595,7 @@ TEST(FreeMonProcessorTest, TestRegistrationResponseValidation) {
<< "http://www.example.com/123"
<< "message"
<< "msg456"
- << "reportingInterval"
- << 1LL))));
+ << "reportingInterval" << 1LL))));
// Negative: large registartation id
ASSERT_NOT_OK(FreeMonProcessor::validateRegistrationResponse(FreeMonRegistrationResponse::parse(
@@ -614,20 +605,16 @@ TEST(FreeMonProcessorTest, TestRegistrationResponseValidation) {
<< "http://www.example.com/123"
<< "message"
<< "msg456"
- << "reportingInterval"
- << 1LL))));
+ << "reportingInterval" << 1LL))));
// Negative: large URL
ASSERT_NOT_OK(FreeMonProcessor::validateRegistrationResponse(FreeMonRegistrationResponse::parse(
IDLParserErrorContext("foo"),
BSON("version" << 1LL << "haltMetricsUploading" << false << "id"
<< "mock123"
- << "informationalURL"
- << std::string(5000, 'b')
- << "message"
+ << "informationalURL" << std::string(5000, 'b') << "message"
<< "msg456"
- << "reportingInterval"
- << 1LL))));
+ << "reportingInterval" << 1LL))));
// Negative: large message
ASSERT_NOT_OK(FreeMonProcessor::validateRegistrationResponse(FreeMonRegistrationResponse::parse(
@@ -636,10 +623,7 @@ TEST(FreeMonProcessorTest, TestRegistrationResponseValidation) {
<< "mock123"
<< "informationalURL"
<< "http://www.example.com/123"
- << "message"
- << std::string(5000, 'c')
- << "reportingInterval"
- << 1LL))));
+ << "message" << std::string(5000, 'c') << "reportingInterval" << 1LL))));
// Negative: too small a reporting interval
ASSERT_NOT_OK(FreeMonProcessor::validateRegistrationResponse(FreeMonRegistrationResponse::parse(
@@ -650,8 +634,7 @@ TEST(FreeMonProcessorTest, TestRegistrationResponseValidation) {
<< "http://www.example.com/123"
<< "message"
<< "msg456"
- << "reportingInterval"
- << 0LL))));
+ << "reportingInterval" << 0LL))));
// Negative: too large a reporting interval
ASSERT_NOT_OK(FreeMonProcessor::validateRegistrationResponse(FreeMonRegistrationResponse::parse(
@@ -662,39 +645,36 @@ TEST(FreeMonProcessorTest, TestRegistrationResponseValidation) {
<< "http://www.example.com/123"
<< "message"
<< "msg456"
- << "reportingInterval"
- << (60LL * 60 * 24 * 30 + 1LL)))));
+ << "reportingInterval" << (60LL * 60 * 24 * 30 + 1LL)))));
}
// Positive: Ensure the response is validated correctly
TEST(FreeMonProcessorTest, TestMetricsResponseValidation) {
- ASSERT_OK(FreeMonProcessor::validateMetricsResponse(FreeMonMetricsResponse::parse(
- IDLParserErrorContext("foo"),
+ ASSERT_OK(FreeMonProcessor::validateMetricsResponse(
+ FreeMonMetricsResponse::parse(IDLParserErrorContext("foo"),
- BSON("version" << 1LL << "haltMetricsUploading" << false << "permanentlyDelete" << false
- << "id"
- << "mock123"
- << "informationalURL"
- << "http://www.example.com/123"
- << "message"
- << "msg456"
- << "reportingInterval"
- << 1LL))));
+ BSON("version" << 1LL << "haltMetricsUploading" << false
+ << "permanentlyDelete" << false << "id"
+ << "mock123"
+ << "informationalURL"
+ << "http://www.example.com/123"
+ << "message"
+ << "msg456"
+ << "reportingInterval" << 1LL))));
// Positive: Support version 2
- ASSERT_OK(FreeMonProcessor::validateMetricsResponse(FreeMonMetricsResponse::parse(
- IDLParserErrorContext("foo"),
+ ASSERT_OK(FreeMonProcessor::validateMetricsResponse(
+ FreeMonMetricsResponse::parse(IDLParserErrorContext("foo"),
- BSON("version" << 2LL << "haltMetricsUploading" << false << "permanentlyDelete" << false
- << "id"
- << "mock123"
- << "informationalURL"
- << "http://www.example.com/123"
- << "message"
- << "msg456"
- << "reportingInterval"
- << 1LL))));
+ BSON("version" << 2LL << "haltMetricsUploading" << false
+ << "permanentlyDelete" << false << "id"
+ << "mock123"
+ << "informationalURL"
+ << "http://www.example.com/123"
+ << "message"
+ << "msg456"
+ << "reportingInterval" << 1LL))));
// Positive: Add resendRegistration
ASSERT_OK(FreeMonProcessor::validateMetricsResponse(FreeMonMetricsResponse::parse(
@@ -707,10 +687,7 @@ TEST(FreeMonProcessorTest, TestMetricsResponseValidation) {
<< "http://www.example.com/123"
<< "message"
<< "msg456"
- << "reportingInterval"
- << 1LL
- << "resendRegistration"
- << true))));
+ << "reportingInterval" << 1LL << "resendRegistration" << true))));
// Positive: max reporting interval
@@ -724,89 +701,74 @@ TEST(FreeMonProcessorTest, TestMetricsResponseValidation) {
<< "http://www.example.com/123"
<< "message"
<< "msg456"
- << "reportingInterval"
- << 60 * 60 * 24 * 30LL))));
+ << "reportingInterval" << 60 * 60 * 24 * 30LL))));
// Negative: bad protocol version
+ ASSERT_NOT_OK(FreeMonProcessor::validateMetricsResponse(
+ FreeMonMetricsResponse::parse(IDLParserErrorContext("foo"),
+ BSON("version" << 42LL << "haltMetricsUploading" << false
+ << "permanentlyDelete" << false << "id"
+ << "mock123"
+ << "informationalURL"
+ << "http://www.example.com/123"
+ << "message"
+ << "msg456"
+ << "reportingInterval" << 1LL))));
+
+ // Negative: halt uploading
+ ASSERT_NOT_OK(FreeMonProcessor::validateMetricsResponse(
+ FreeMonMetricsResponse::parse(IDLParserErrorContext("foo"),
+ BSON("version" << 1LL << "haltMetricsUploading" << true
+ << "permanentlyDelete" << false << "id"
+ << "mock123"
+ << "informationalURL"
+ << "http://www.example.com/123"
+ << "message"
+ << "msg456"
+ << "reportingInterval" << 1LL))));
+
+ // Negative: large registartation id
ASSERT_NOT_OK(FreeMonProcessor::validateMetricsResponse(FreeMonMetricsResponse::parse(
IDLParserErrorContext("foo"),
- BSON("version" << 42LL << "haltMetricsUploading" << false << "permanentlyDelete" << false
- << "id"
- << "mock123"
- << "informationalURL"
+ BSON("version" << 1LL << "haltMetricsUploading" << false << "permanentlyDelete" << false
+ << "id" << std::string(5000, 'a') << "informationalURL"
<< "http://www.example.com/123"
<< "message"
<< "msg456"
- << "reportingInterval"
- << 1LL))));
+ << "reportingInterval" << 1LL))));
- // Negative: halt uploading
+ // Negative: large URL
ASSERT_NOT_OK(FreeMonProcessor::validateMetricsResponse(FreeMonMetricsResponse::parse(
IDLParserErrorContext("foo"),
- BSON("version" << 1LL << "haltMetricsUploading" << true << "permanentlyDelete" << false
- << "id"
+ BSON("version" << 1LL << "haltMetricsUploading" << false
+
+ << "permanentlyDelete" << false << "id"
<< "mock123"
- << "informationalURL"
- << "http://www.example.com/123"
- << "message"
+ << "informationalURL" << std::string(5000, 'b') << "message"
<< "msg456"
- << "reportingInterval"
- << 1LL))));
+ << "reportingInterval" << 1LL))));
- // Negative: large registartation id
+ // Negative: large message
ASSERT_NOT_OK(FreeMonProcessor::validateMetricsResponse(FreeMonMetricsResponse::parse(
IDLParserErrorContext("foo"),
BSON("version" << 1LL << "haltMetricsUploading" << false << "permanentlyDelete" << false
<< "id"
- << std::string(5000, 'a')
+ << "mock123"
<< "informationalURL"
<< "http://www.example.com/123"
- << "message"
- << "msg456"
- << "reportingInterval"
- << 1LL))));
+ << "message" << std::string(5000, 'c') << "reportingInterval" << 1LL))));
- // Negative: large URL
+ // Negative: too small a reporting interval
ASSERT_NOT_OK(FreeMonProcessor::validateMetricsResponse(
FreeMonMetricsResponse::parse(IDLParserErrorContext("foo"),
BSON("version" << 1LL << "haltMetricsUploading" << false
-
- << "permanentlyDelete"
- << false
- << "id"
+ << "permanentlyDelete" << false << "id"
<< "mock123"
<< "informationalURL"
- << std::string(5000, 'b')
+ << "http://www.example.com/123"
<< "message"
<< "msg456"
- << "reportingInterval"
- << 1LL))));
-
- // Negative: large message
- ASSERT_NOT_OK(FreeMonProcessor::validateMetricsResponse(FreeMonMetricsResponse::parse(
- IDLParserErrorContext("foo"),
- BSON("version" << 1LL << "haltMetricsUploading" << false << "permanentlyDelete" << false
- << "id"
- << "mock123"
- << "informationalURL"
- << "http://www.example.com/123"
- << "message"
- << std::string(5000, 'c')
- << "reportingInterval"
- << 1LL))));
-
- // Negative: too small a reporting interval
- ASSERT_NOT_OK(FreeMonProcessor::validateMetricsResponse(FreeMonMetricsResponse::parse(
- IDLParserErrorContext("foo"),
- BSON("version" << 1LL << "haltMetricsUploading" << false << "permanentlyDelete" << false
- << "id"
- << "mock123"
- << "informationalURL"
- << "http://www.example.com/123"
- << "message"
- << "msg456"
- << "reportingInterval"
- << 0LL))));
+ << "reportingInterval" << 0LL))));
// Negative: too large a reporting interval
ASSERT_NOT_OK(FreeMonProcessor::validateMetricsResponse(FreeMonMetricsResponse::parse(
@@ -818,8 +780,7 @@ TEST(FreeMonProcessorTest, TestMetricsResponseValidation) {
<< "http://www.example.com/123"
<< "message"
<< "msg456"
- << "reportingInterval"
- << (60LL * 60 * 24 * 30 + 1LL)))));
+ << "reportingInterval" << (60LL * 60 * 24 * 30 + 1LL)))));
}
/**
diff --git a/src/mongo/db/free_mon/free_mon_message.h b/src/mongo/db/free_mon/free_mon_message.h
index 55b3091c34a..71a34dd84b4 100644
--- a/src/mongo/db/free_mon/free_mon_message.h
+++ b/src/mongo/db/free_mon/free_mon_message.h
@@ -67,8 +67,8 @@ enum class FreeMonMessageType {
AsyncRegisterFail,
/**
- * Unregister server from server command.
- */
+ * Unregister server from server command.
+ */
UnregisterCommand,
/**
@@ -117,24 +117,24 @@ enum class FreeMonMessageType {
*/
enum class RegistrationType {
/**
- * Do not register on start because it was not configured via commandline/config file.
- */
+ * Do not register on start because it was not configured via commandline/config file.
+ */
DoNotRegister,
/**
- * Register immediately on start since we are a standalone.
- */
+ * Register immediately on start since we are a standalone.
+ */
RegisterOnStart,
/**
- * Register after transition to becoming primary because we are in a replica set,
- * and Free Monitoring has been explicitly enabled.
- */
+ * Register after transition to becoming primary because we are in a replica set,
+ * and Free Monitoring has been explicitly enabled.
+ */
RegisterAfterOnTransitionToPrimary,
/**
- * As above, but only if we have been runtime enabled.
- */
+ * As above, but only if we have been runtime enabled.
+ */
RegisterAfterOnTransitionToPrimaryIfEnabled,
};
@@ -334,7 +334,7 @@ private:
/**
* For the messages that the caller needs to wait on, this provides a mechanism to wait on messages
* to be processed.
-*/
+ */
template <FreeMonMessageType typeT>
struct FreeMonWaitablePayloadForMessage {
using payload_type = void;
diff --git a/src/mongo/db/free_mon/free_mon_mongod.cpp b/src/mongo/db/free_mon/free_mon_mongod.cpp
index 008790e289a..fbf9255ddce 100644
--- a/src/mongo/db/free_mon/free_mon_mongod.cpp
+++ b/src/mongo/db/free_mon/free_mon_mongod.cpp
@@ -105,7 +105,6 @@ public:
reqObj.objdata(), reqObj.objdata() + reqObj.objsize());
return post("/register", data).then([](DataBuilder&& blob) {
-
if (!blob.size()) {
uasserted(ErrorCodes::FreeMonHttpTemporaryFailure, "Empty response received");
}
@@ -128,7 +127,6 @@ public:
reqObj.objdata(), reqObj.objdata() + reqObj.objsize());
return post("/metrics", data).then([](DataBuilder&& blob) {
-
if (!blob.size()) {
uasserted(ErrorCodes::FreeMonHttpTemporaryFailure, "Empty response received");
}
@@ -152,7 +150,7 @@ private:
std::string url(FreeMonEndpointURL + path.toString());
auto status = _executor->scheduleWork(
- [ promise = std::move(pf.promise), url = std::move(url), data = std::move(data), this ](
+ [promise = std::move(pf.promise), url = std::move(url), data = std::move(data), this](
const executor::TaskExecutor::CallbackArgs& cbArgs) mutable {
ConstDataRange cdr(data->data(), data->size());
try {
@@ -202,28 +200,11 @@ public:
// Try to filter server status to make it cheaper to collect. Harmless if we gather
// extra
BSON("serverStatus" << 1 << "storageEngine" << true << "extra_info" << false
- << "opLatencies"
- << false
- << "opcountersRepl"
- << false
- << "opcounters"
- << false
- << "transactions"
- << false
- << "connections"
- << false
- << "network"
- << false
- << "tcMalloc"
- << false
- << "network"
- << false
- << "wiredTiger"
- << false
- << "sharding"
- << false
- << "metrics"
- << false)) {}
+ << "opLatencies" << false << "opcountersRepl" << false
+ << "opcounters" << false << "transactions" << false
+ << "connections" << false << "network" << false << "tcMalloc"
+ << false << "network" << false << "wiredTiger" << false
+ << "sharding" << false << "metrics" << false)) {}
std::string name() const final {
return "storageEngine";
diff --git a/src/mongo/db/free_mon/free_mon_op_observer.cpp b/src/mongo/db/free_mon/free_mon_op_observer.cpp
index 09bfb3ff62c..29e380c8baa 100644
--- a/src/mongo/db/free_mon/free_mon_op_observer.cpp
+++ b/src/mongo/db/free_mon/free_mon_op_observer.cpp
@@ -42,8 +42,9 @@ bool isStandaloneOrPrimary(OperationContext* opCtx) {
auto replCoord = repl::ReplicationCoordinator::get(opCtx);
const bool isReplSet =
replCoord->getReplicationMode() == repl::ReplicationCoordinator::modeReplSet;
- return !isReplSet || (repl::ReplicationCoordinator::get(opCtx)->getMemberState() ==
- repl::MemberState::RS_PRIMARY);
+ return !isReplSet ||
+ (repl::ReplicationCoordinator::get(opCtx)->getMemberState() ==
+ repl::MemberState::RS_PRIMARY);
}
const auto getFreeMonDeleteState = OperationContext::declareDecoration<bool>();
diff --git a/src/mongo/db/free_mon/free_mon_options.h b/src/mongo/db/free_mon/free_mon_options.h
index 60203dc2b94..19f707e8b65 100644
--- a/src/mongo/db/free_mon/free_mon_options.h
+++ b/src/mongo/db/free_mon/free_mon_options.h
@@ -35,8 +35,8 @@
namespace mongo {
/**
-* Free Moniting Command line choices
-*/
+ * Free Moniting Command line choices
+ */
enum class EnableCloudStateEnum : std::int32_t {
kOn,
kOff,
diff --git a/src/mongo/db/free_mon/free_mon_processor.cpp b/src/mongo/db/free_mon/free_mon_processor.cpp
index 7013d72e244..8cb57bda42f 100644
--- a/src/mongo/db/free_mon/free_mon_processor.cpp
+++ b/src/mongo/db/free_mon/free_mon_processor.cpp
@@ -465,36 +465,29 @@ Status FreeMonProcessor::validateRegistrationResponse(const FreeMonRegistrationR
return Status(ErrorCodes::FreeMonHttpPermanentFailure,
str::stream()
<< "Unexpected registration response protocol version, expected ("
- << kMinProtocolVersion
- << ", "
- << kMaxProtocolVersion
- << "), received '"
- << resp.getVersion()
- << "'");
+ << kMinProtocolVersion << ", " << kMaxProtocolVersion << "), received '"
+ << resp.getVersion() << "'");
}
if (resp.getId().size() >= kRegistrationIdMaxLength) {
return Status(ErrorCodes::FreeMonHttpPermanentFailure,
str::stream() << "Id is '" << resp.getId().size()
<< "' bytes in length, maximum allowed length is '"
- << kRegistrationIdMaxLength
- << "'");
+ << kRegistrationIdMaxLength << "'");
}
if (resp.getInformationalURL().size() >= kInformationalURLMaxLength) {
return Status(ErrorCodes::FreeMonHttpPermanentFailure,
str::stream() << "InformationURL is '" << resp.getInformationalURL().size()
<< "' bytes in length, maximum allowed length is '"
- << kInformationalURLMaxLength
- << "'");
+ << kInformationalURLMaxLength << "'");
}
if (resp.getMessage().size() >= kInformationalMessageMaxLength) {
return Status(ErrorCodes::FreeMonHttpPermanentFailure,
str::stream() << "Message is '" << resp.getMessage().size()
<< "' bytes in length, maximum allowed length is '"
- << kInformationalMessageMaxLength
- << "'");
+ << kInformationalMessageMaxLength << "'");
}
if (resp.getUserReminder().is_initialized() &&
@@ -502,19 +495,15 @@ Status FreeMonProcessor::validateRegistrationResponse(const FreeMonRegistrationR
return Status(ErrorCodes::FreeMonHttpPermanentFailure,
str::stream() << "UserReminder is '" << resp.getUserReminder().get().size()
<< "' bytes in length, maximum allowed length is '"
- << kUserReminderMaxLength
- << "'");
+ << kUserReminderMaxLength << "'");
}
if (resp.getReportingInterval() < kReportingIntervalSecondsMin ||
resp.getReportingInterval() > kReportingIntervalSecondsMax) {
return Status(ErrorCodes::FreeMonHttpPermanentFailure,
str::stream() << "Reporting Interval '" << resp.getReportingInterval()
- << "' must be in the range ["
- << kReportingIntervalSecondsMin
- << ","
- << kReportingIntervalSecondsMax
- << "]");
+ << "' must be in the range [" << kReportingIntervalSecondsMin
+ << "," << kReportingIntervalSecondsMax << "]");
}
// Did cloud ask us to stop uploading?
@@ -540,30 +529,24 @@ Status FreeMonProcessor::validateMetricsResponse(const FreeMonMetricsResponse& r
if (!(resp.getVersion() >= kMinProtocolVersion && resp.getVersion() <= kMaxProtocolVersion)) {
return Status(ErrorCodes::FreeMonHttpPermanentFailure,
str::stream() << "Unexpected metrics response protocol version, expected ("
- << kMinProtocolVersion
- << ", "
- << kMaxProtocolVersion
- << "), received '"
- << resp.getVersion()
- << "'");
+ << kMinProtocolVersion << ", " << kMaxProtocolVersion
+ << "), received '" << resp.getVersion() << "'");
}
if (resp.getId().is_initialized() && resp.getId().get().size() >= kRegistrationIdMaxLength) {
return Status(ErrorCodes::FreeMonHttpPermanentFailure,
str::stream() << "Id is '" << resp.getId().get().size()
<< "' bytes in length, maximum allowed length is '"
- << kRegistrationIdMaxLength
- << "'");
+ << kRegistrationIdMaxLength << "'");
}
if (resp.getInformationalURL().is_initialized() &&
resp.getInformationalURL().get().size() >= kInformationalURLMaxLength) {
return Status(ErrorCodes::FreeMonHttpPermanentFailure,
- str::stream() << "InformationURL is '"
- << resp.getInformationalURL().get().size()
- << "' bytes in length, maximum allowed length is '"
- << kInformationalURLMaxLength
- << "'");
+ str::stream()
+ << "InformationURL is '" << resp.getInformationalURL().get().size()
+ << "' bytes in length, maximum allowed length is '"
+ << kInformationalURLMaxLength << "'");
}
if (resp.getMessage().is_initialized() &&
@@ -571,8 +554,7 @@ Status FreeMonProcessor::validateMetricsResponse(const FreeMonMetricsResponse& r
return Status(ErrorCodes::FreeMonHttpPermanentFailure,
str::stream() << "Message is '" << resp.getMessage().get().size()
<< "' bytes in length, maximum allowed length is '"
- << kInformationalMessageMaxLength
- << "'");
+ << kInformationalMessageMaxLength << "'");
}
if (resp.getUserReminder().is_initialized() &&
@@ -580,19 +562,15 @@ Status FreeMonProcessor::validateMetricsResponse(const FreeMonMetricsResponse& r
return Status(ErrorCodes::FreeMonHttpPermanentFailure,
str::stream() << "UserReminder is '" << resp.getUserReminder().get().size()
<< "' bytes in length, maximum allowed length is '"
- << kUserReminderMaxLength
- << "'");
+ << kUserReminderMaxLength << "'");
}
if (resp.getReportingInterval() < kReportingIntervalSecondsMin ||
resp.getReportingInterval() > kReportingIntervalSecondsMax) {
return Status(ErrorCodes::FreeMonHttpPermanentFailure,
str::stream() << "Reporting Interval '" << resp.getReportingInterval()
- << "' must be in the range ["
- << kReportingIntervalSecondsMin
- << ","
- << kReportingIntervalSecondsMax
- << "]");
+ << "' must be in the range [" << kReportingIntervalSecondsMin
+ << "," << kReportingIntervalSecondsMax << "]");
}
// Did cloud ask us to stop uploading?
diff --git a/src/mongo/db/free_mon/free_mon_queue_test.cpp b/src/mongo/db/free_mon/free_mon_queue_test.cpp
index ea38c7bad5c..ad6104c5126 100644
--- a/src/mongo/db/free_mon/free_mon_queue_test.cpp
+++ b/src/mongo/db/free_mon/free_mon_queue_test.cpp
@@ -146,13 +146,11 @@ TEST_F(FreeMonQueueTest, TestQueueStop) {
auto swSchedule =
_mockThreadPool->scheduleWork([&](const executor::TaskExecutor::CallbackArgs& cbArgs) {
-
barrier.countDownAndWait();
// Try to dequeue from a stopped task queue
auto item = queue.dequeue(_opCtx.get()->getServiceContext()->getPreciseClockSource());
ASSERT_FALSE(item.is_initialized());
-
});
ASSERT_OK(swSchedule.getStatus());