Skip to content

Commit 5f97847

Browse files
committed
Quieten down kafka teardown script
Kafka teardown script can exit with failure, typically when trying to stop the broker. This commit logs the error code if the scripts fail rather than crash out causing build failure. Fixes #11905
1 parent 001866c commit 5f97847

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

qa/integration/services/kafka_teardown.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ KAFKA_HOME=$INSTALL_DIR/kafka
88

99
stop_kafka() {
1010
echo "Stopping Kafka broker"
11-
$KAFKA_HOME/bin/kafka-server-stop.sh
11+
$KAFKA_HOME/bin/kafka-server-stop.sh || EXIT=$?
12+
echo "Kafka broker stopped with exit code $EXIT"
1213
echo "Stopping zookeeper"
13-
$KAFKA_HOME/bin/zookeeper-server-stop.sh
14+
$KAFKA_HOME/bin/zookeeper-server-stop.sh || EXIT=$?
15+
echo "Zookeeper stopped with exit code $EXIT"
1416
}
1517

1618
# delete test topic
1719
echo "Deleting test topic in Kafka"
18-
$KAFKA_HOME/bin/kafka-topics.sh --delete --topic logstash_topic_plain --zookeeper localhost:2181 --if-exists
20+
$KAFKA_HOME/bin/kafka-topics.sh --delete --topic logstash_topic_plain --zookeeper localhost:2181 --if-exists || EXIT=$?
21+
echo "Deleted test topic in Kafka with exit code $EXIT"
1922
stop_kafka
2023
rm -rf /tmp/ls_integration/kafka-logs
2124
rm -rf /tmp/zookeeper

0 commit comments

Comments
 (0)