Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/apps/relay/RelayIngester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void RelayServer::runIngester(ThreadPool<MsgIngester>::Thread &thr) {
} catch (std::exception &e) {
sendOKResponse(msg->connId, arr[1].is_object() && arr[1].at("id").is_string() ? arr[1].at("id").get_string() : "?",
false, std::string("invalid: ") + e.what());
if (cfg().relay__logging__invalidEvents) LI << "Rejected invalid event: " << e.what();
if (cfg().relay__logging__invalidEvents) LI << "Rejected invalid event from [" << msg->connId << "/" << renderIP(msg->ipAddr) << "]: " << e.what();
}
} else if (cmd == "AUTH") {
PROM_INC_CLIENT_MSG(cmd);
Expand All @@ -55,6 +55,7 @@ void RelayServer::runIngester(ThreadPool<MsgIngester>::Thread &thr) {
try {
ingesterProcessReq(txn, rsctx, msg->connId, arr, cmd == "COUNT", subIdStr);
} catch (std::exception &e) {
LI << "Bad req from [" << msg->connId << "/" << renderIP(msg->ipAddr) << "]: " << e.what();
if (subIdStr.size()) sendClosedError(msg->connId, subIdStr, std::string("bad req: ") + e.what());
else sendNoticeError(msg->connId, std::string("bad req: ") + e.what());
}
Expand All @@ -65,6 +66,7 @@ void RelayServer::runIngester(ThreadPool<MsgIngester>::Thread &thr) {
try {
ingesterProcessClose(txn, msg->connId, arr);
} catch (std::exception &e) {
LI << "Bad close from [" << msg->connId << "/" << renderIP(msg->ipAddr) << "]: " << e.what();
sendNoticeError(msg->connId, std::string("bad close: ") + e.what());
}
} else if (cmd == "NEG-OPEN" || cmd == "NEG-MSG" || cmd == "NEG-CLOSE") {
Expand All @@ -74,6 +76,7 @@ void RelayServer::runIngester(ThreadPool<MsgIngester>::Thread &thr) {
try {
ingesterProcessNegentropy(txn, msg->connId, arr);
} catch (std::exception &e) {
LI << "Negentropy error from [" << msg->connId << "/" << renderIP(msg->ipAddr) << "]: " << e.what();
sendNoticeError(msg->connId, std::string("negentropy error: ") + e.what());
}
} else {
Expand All @@ -86,6 +89,7 @@ void RelayServer::runIngester(ThreadPool<MsgIngester>::Thread &thr) {
throw herr("unparseable message");
}
} catch (std::exception &e) {
LI << "Bad msg from [" << msg->connId << "/" << renderIP(msg->ipAddr) << "]: " << e.what();
sendNoticeError(msg->connId, std::string("bad msg: ") + e.what());
}
} else if (auto msg = std::get_if<MsgIngester::CloseConn>(&newMsg.msg)) {
Expand Down