@@ -23,8 +23,8 @@ use stackable_operator::{
2323 apps:: v1:: { StatefulSet , StatefulSetSpec , StatefulSetUpdateStrategy } ,
2424 core:: v1:: {
2525 ConfigMapKeySelector , ConfigMapVolumeSource , ContainerPort , EnvVar , EnvVarSource ,
26- ExecAction , Lifecycle , LifecycleHandler , ObjectFieldSelector , PodSpec , Probe ,
27- ServiceAccount , SleepAction , TCPSocketAction , Volume ,
26+ ExecAction , ObjectFieldSelector , PodSpec , Probe , ServiceAccount , TCPSocketAction ,
27+ Volume ,
2828 } ,
2929 } ,
3030 apimachinery:: pkg:: { apis:: meta:: v1:: LabelSelector , util:: intstr:: IntOrString } ,
@@ -658,6 +658,7 @@ pub fn build_controller_rolegroup_statefulset(
658658 kafka_security,
659659 & resolved_product_image. product_version,
660660 ) ] )
661+ . add_env_var ( "PRE_STOP_CONTROLLER_SLEEP_SECONDS" , "5" )
661662 . add_env_var (
662663 "EXTRA_ARGS" ,
663664 kafka_role
@@ -756,19 +757,7 @@ pub fn build_controller_rolegroup_statefulset(
756757 )
757758 . context ( AddVolumesAndVolumeMountsSnafu ) ?;
758759
759- // Currently, Controllers shutdown very fast, too fast in most times (flakyness) for the Brokers
760- // to off load properly. The Brokers then try to connect to any controllers until the
761- // `gracefulShutdownTimeout` is reached and the pod is finally killed.
762- // The `pre-stop` hook will delay the kill signal to the Controllers to provide the Brokers more
763- // time to offload data.
764- let mut kafka_container = cb_kafka. build ( ) ;
765- kafka_container. lifecycle = Some ( Lifecycle {
766- pre_stop : Some ( LifecycleHandler {
767- sleep : Some ( SleepAction { seconds : 10 } ) ,
768- ..Default :: default ( )
769- } ) ,
770- ..Default :: default ( )
771- } ) ;
760+ let kafka_container = cb_kafka. build ( ) ;
772761
773762 pod_builder
774763 . metadata ( metadata)
0 commit comments