Skip to content

Commit bd0ffa4

Browse files
committed
[Cleanup] Remove logging from EPE::getConnHandler
The packet validator already verifies that the connection is set up as a DCP connection before calling into the engine (the packet validator did not check for DCP in the cases where we didn't want the logging) Change-Id: Ib6e805c2292c489e6e2597ccea81da2f2b586a1f Reviewed-on: http://review.couchbase.org/c/kv_engine/+/140961 Tested-by: Build Bot <[email protected]> Reviewed-by: Dave Rigby <[email protected]>
1 parent 1e7056f commit bd0ffa4

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

engines/ep/src/ep_engine.cc

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,7 @@ ENGINE_ERROR_CODE EventuallyPersistentEngine::get_failover_log(
14251425
return ENGINE_EWOULDBLOCK;
14261426
}
14271427

1428-
ConnHandler* conn = engine->getConnHandler(cookie, false);
1428+
ConnHandler* conn = engine->getConnHandler(cookie);
14291429
// Note: (conn != nullptr) only if conn is a DCP connection
14301430
if (conn) {
14311431
auto* producer = dynamic_cast<DcpProducer*>(conn);
@@ -6231,21 +6231,16 @@ ENGINE_ERROR_CODE EventuallyPersistentEngine::dcpAddStream(const void* cookie,
62316231
return errCode;
62326232
}
62336233

6234-
ConnHandler* EventuallyPersistentEngine::getConnHandler(const void* cookie,
6235-
bool logNonExistent) {
6234+
ConnHandler* EventuallyPersistentEngine::getConnHandler(const void* cookie) {
62366235
auto* iface = getDcpConnHandler(cookie);
62376236
if (iface) {
62386237
auto* handler = dynamic_cast<ConnHandler*>(iface);
62396238
if (handler) {
62406239
return handler;
62416240
}
6242-
}
6243-
6244-
if (logNonExistent) {
6245-
auto li = serverApi->cookie->get_log_info(cookie);
6246-
EP_LOG_WARN("{}: Invalid streaming connection: cookie:{}",
6247-
li.first,
6248-
cb::to_hex(uint64_t(cookie)));
6241+
throw std::logic_error(
6242+
"EventuallyPersistentEngine::getConnHandler(): The registered "
6243+
"connection handler is not a ConnHandler");
62496244
}
62506245

62516246
return nullptr;
@@ -6444,7 +6439,7 @@ ENGINE_ERROR_CODE EventuallyPersistentEngine::getAllVBucketSequenceNumbers(
64446439
return ENGINE_ERROR_CODE(accessStatus);
64456440
}
64466441

6447-
auto* connhandler = getConnHandler(cookie, false);
6442+
auto* connhandler = getConnHandler(cookie);
64486443
bool supportsSyncWrites = connhandler && connhandler->isSyncWritesEnabled();
64496444

64506445
std::vector<char> payload;

engines/ep/src/ep_engine.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -733,10 +733,9 @@ class EventuallyPersistentEngine : public EngineIface, public DcpIface {
733733
* Get the connection handler for the provided cookie
734734
*
735735
* @param cookie the cookie to look up
736-
* @param logNonExistent Should we log if we don't find a connection handler
737736
* @return the pointer to the connection handler if found, nullptr otherwise
738737
*/
739-
ConnHandler* getConnHandler(const void* cookie, bool logNonExistent = true);
738+
ConnHandler* getConnHandler(const void* cookie);
740739

741740
/**
742741
* Method to add a cookie to allKeysLookups to store the result of the

0 commit comments

Comments
 (0)