summaryrefslogtreecommitdiffstats
path: root/configd
diff options
context:
space:
mode:
authorArne H Juul <arnej@yahoo-inc.com>2016-07-05 13:03:43 +0200
committerArne H Juul <arnej@yahoo-inc.com>2016-07-05 13:03:49 +0200
commit9636d119ef9cd0f000c77164a44468beb141b14e (patch)
treee2782beebc3af3237ee0494a8acb79eb936ddd6b /configd
parent983dd5714698d929a14a124cc1de3e4039a7ef0c (diff)
less spurious warnings at shutdown
* the storageserver didn't like getting the TERM signal both from runserver (via killpg) and sentinel, so it would print a warning to stderr. But the warning didn't end with a newline. * the line-splitter used by config-sentinel didn't handle input that didn't end with newline before EOF well, so the warning was never handled and sent to the vespa.log file earlier. * only print warning if too many signals seen (> 2), and end it with a newline. * don't ignore last byte of input if we can avoid it.
Diffstat (limited to 'configd')
-rw-r--r--configd/src/apps/sentinel/line-splitter.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/configd/src/apps/sentinel/line-splitter.cpp b/configd/src/apps/sentinel/line-splitter.cpp
index e52f4e3f33e..ec1fe41e766 100644
--- a/configd/src/apps/sentinel/line-splitter.cpp
+++ b/configd/src/apps/sentinel/line-splitter.cpp
@@ -88,7 +88,11 @@ LineSplitter::getLine()
char *start = &_buffer[_readPos];
char *end = static_cast<char *>(memchr(start, '\n', bufLen));
if (_eof && !end) {
- end = &_buffer[_writePos-1]; // pretend last byte sent was \n
+ if (_writePos < _size) {
+ end = &_buffer[_writePos]; // pretend last byte sent was followed by \n
+ } else {
+ end = &_buffer[_writePos-1]; // pretend last byte sent was \n
+ }
}
if (end) {
*end = '\0';