flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-10110) Harden e2e Kafka shutdown
Date Thu, 16 Aug 2018 07:55:00 GMT

    [ https://issues.apache.org/jira/browse/FLINK-10110?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16582115#comment-16582115
] 

ASF GitHub Bot commented on FLINK-10110:
----------------------------------------

tillrohrmann closed pull request #6531: [release-1.6][FLINK-10110][tests] Harden Kafka component
shut down for E2E tests
URL: https://github.com/apache/flink/pull/6531
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/flink-end-to-end-tests/test-scripts/kafka-common.sh b/flink-end-to-end-tests/test-scripts/kafka-common.sh
index f0a37b85998..26f3f6ee82d 100644
--- a/flink-end-to-end-tests/test-scripts/kafka-common.sh
+++ b/flink-end-to-end-tests/test-scripts/kafka-common.sh
@@ -75,6 +75,18 @@ function start_kafka_cluster {
 function stop_kafka_cluster {
   $KAFKA_DIR/bin/kafka-server-stop.sh
   $KAFKA_DIR/bin/zookeeper-server-stop.sh
+
+  PIDS=$(jps -vl | grep -i 'kafka\.Kafka' | grep java | grep -v grep | awk '{print $1}')
+
+  if [ ! -z "$PIDS" ]; then
+    kill -s TERM $PIDS
+  fi
+
+  PIDS=$(jps -vl | grep java | grep -i QuorumPeerMain | grep -v grep | awk '{print $1}')
+
+  if [ ! -z "$PIDS" ]; then
+    kill -s TERM $PIDS
+  fi
 }
 
 function create_kafka_topic {
diff --git a/flink-end-to-end-tests/test-scripts/test_confluent_schema_registry.sh b/flink-end-to-end-tests/test-scripts/test_confluent_schema_registry.sh
index be0b0147b6e..323234fa683 100755
--- a/flink-end-to-end-tests/test-scripts/test_confluent_schema_registry.sh
+++ b/flink-end-to-end-tests/test-scripts/test_confluent_schema_registry.sh
@@ -38,8 +38,8 @@ function test_cleanup {
   # don't call ourselves again for normal exit
   trap "" EXIT
 
-  stop_kafka_cluster
   stop_confluent_schema_registry
+  stop_kafka_cluster
 }
 
 trap test_cleanup INT


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Harden e2e Kafka shutdown
> -------------------------
>
>                 Key: FLINK-10110
>                 URL: https://issues.apache.org/jira/browse/FLINK-10110
>             Project: Flink
>          Issue Type: Improvement
>          Components: Tests
>    Affects Versions: 1.6.0
>            Reporter: Till Rohrmann
>            Assignee: Till Rohrmann
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.6.1, 1.7.0
>
>
> Due to KAFKA-4931, the shutdown of Kafka components can fail if the output of {{ps}}
is limited to 4096 characters. Therefore, it can happen that e2e tests which start Kafka don't
properly shut it down. I suggest to fix this problem by hardening our {{stop_kafka_cluster}}
in {{kafka-common.sh}}.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message