smengcl commented on code in PR #5011:
URL: https://github.com/apache/ozone/pull/5011#discussion_r1249551052
##########
hadoop-ozone/dist/src/main/compose/testlib.sh:
##########
@@ -158,13 +158,12 @@ start_docker_env(){
export OZONE_SAFEMODE_MIN_DATANODES="${datanode_count}"
docker-compose --ansi never down
- if ! { docker-compose --ansi never up -d --scale
datanode="${datanode_count}" \
- && wait_for_safemode_exit \
- && wait_for_om_leader ; }; then
- [[ -n "$OUTPUT_NAME" ]] || OUTPUT_NAME="$COMPOSE_ENV_NAME"
- stop_docker_env
- return 1
- fi
+
+ trap stop_docker_env EXIT HUP INT TERM
+
+ docker-compose --ansi never up -d --scale datanode="${datanode_count}"
Review Comment:
ah makes sense now. That is exactly what `trap` is for. Thanks @adoroszlai .
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]