aboutsummaryrefslogtreecommitdiffstats
path: root/fnet/src
diff options
context:
space:
mode:
authorArne Juul <arnej@yahoo-inc.com>2018-06-12 12:50:28 +0200
committerArne Juul <arnej@yahoo-inc.com>2018-06-12 13:51:45 +0200
commit016e584f0ad5a071e13d75eb8ad5ddb46b8c54f5 (patch)
tree869d4e4a4c4b8a9f9ef691b2980009017dece9e6 /fnet/src
parent22796dddd3dc025018093783328ac87535ffecd9 (diff)
use LOG_ABORT not just abort()
* abort() has the unfortunate effect that nothing is seen in the log, just an event (which is usually not displayed); so ops people don't see that the program is crashing at all. * LOG_ABORT("message") will log an error with the message (and the file and line) before calling abort(), so it's easy to see what happened. * add or move <vespa/log/log.h> include and LOG_SETUP lines before LOG_ABORT is used (or included).
Diffstat (limited to 'fnet/src')
-rw-r--r--fnet/src/vespa/fnet/controlpacket.cpp7
-rw-r--r--fnet/src/vespa/fnet/dummypacket.cpp6
-rw-r--r--fnet/src/vespa/fnet/frt/invoker.cpp2
3 files changed, 10 insertions, 5 deletions
diff --git a/fnet/src/vespa/fnet/controlpacket.cpp b/fnet/src/vespa/fnet/controlpacket.cpp
index 53c23f444ab..f4d10e48353 100644
--- a/fnet/src/vespa/fnet/controlpacket.cpp
+++ b/fnet/src/vespa/fnet/controlpacket.cpp
@@ -4,6 +4,9 @@
#include "context.h"
#include <vespa/vespalib/util/stringfmt.h>
+#include <vespa/log/log.h>
+LOG_SETUP(".fnet.controlpacket");
+
void
FNET_ControlPacket::Free()
{
@@ -60,13 +63,13 @@ FNET_ControlPacket::GetLength()
void
FNET_ControlPacket::Encode(FNET_DataBuffer *)
{
- abort();
+ LOG_ABORT("should not be reached");
}
bool
FNET_ControlPacket::Decode(FNET_DataBuffer *, uint32_t)
{
- abort(); return false;
+ LOG_ABORT("should not be reached");
}
vespalib::string
diff --git a/fnet/src/vespa/fnet/dummypacket.cpp b/fnet/src/vespa/fnet/dummypacket.cpp
index 9e7ce37236b..0c2c2ee883d 100644
--- a/fnet/src/vespa/fnet/dummypacket.cpp
+++ b/fnet/src/vespa/fnet/dummypacket.cpp
@@ -4,6 +4,8 @@
#include "context.h"
#include <vespa/vespalib/util/stringfmt.h>
+#include <vespa/log/log.h>
+LOG_SETUP(".fnet.controlpacket");
FNET_DummyPacket::FNET_DummyPacket()
{
@@ -36,13 +38,13 @@ FNET_DummyPacket::GetLength()
void
FNET_DummyPacket::Encode(FNET_DataBuffer *)
{
- abort();
+ LOG_ABORT("should not be reached");
}
bool
FNET_DummyPacket::Decode(FNET_DataBuffer *, uint32_t)
{
- abort(); return false;
+ LOG_ABORT("should not be reached");
}
vespalib::string
diff --git a/fnet/src/vespa/fnet/frt/invoker.cpp b/fnet/src/vespa/fnet/frt/invoker.cpp
index ce4daa988de..f2dc331c707 100644
--- a/fnet/src/vespa/fnet/frt/invoker.cpp
+++ b/fnet/src/vespa/fnet/frt/invoker.cpp
@@ -142,7 +142,7 @@ void
FRT_HookInvoker::HandleReturn()
{
// hooks cannot be detached
- abort();
+ LOG_ABORT("should not be reached");
}