Skip to content

Commit 8327e08

Browse files
committed
fix(kci-dockerwatch): Log crash only if container stops
Triggering by keyword doesn't work well yet, because we have a lot of logging from kcidb-bridge which might contain trigger strings from python crashes on DUT. Signed-off-by: Denys Fedoryshchenko <[email protected]>
1 parent eb47002 commit 8327e08

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

tools/kci-dockerwatch.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,13 @@ def container_logger_thread(container, logpath):
5555
with open(logpath, 'a') as logfile:
5656
for line in container.logs(stream=True):
5757
logfile.write(line.decode('utf-8'))
58-
# detect crash keywords, lowercase both
59-
if any(keyword.lower() in line.decode('utf-8').lower() for keyword in crash_keywords):
60-
if is_msg_throttle():
61-
logging.error(f'Crash detected in container: {container.name} id: {container.id}, but throttled')
62-
continue
63-
else:
64-
logging.error(f'Crash detected in container: {container.name} id: {container.id}')
65-
message_bot(f'Crash detected in container: {container.name} id: {container.id}')
58+
59+
if is_msg_throttle():
60+
logging.error(f'Crash detected in container: {container.name} id: {container.id}, but throttled')
61+
else:
62+
logging.error(f'Crash detected in container: {container.name} id: {container.id}')
63+
message_bot(f'Crash detected in container: {container.name} id: {container.id}')
64+
6665
with tlock:
6766
active_containers.remove(container.id)
6867

0 commit comments

Comments
 (0)