You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the Kafka module spawns a container that doesn't properly handle signals (term/int). The following (next) unit test reproduces the issue:
funcTestKafkaGracefulShutdown(t*testing.T) {
ctx:=context.Background()
kafkaContainer, err:=RunContainer(ctx, WithClusterID("kraftCluster"), testcontainers.WithImage("confluentinc/confluent-local:7.5.0"))
iferr!=nil {
t.Fatal(err)
}
done:=make(chanstruct{})
gofunc() {
// Wait 60 seconds, after that the pod will be forcefully terminated.timeout:=60*time.SecondkafkaContainer.Stop(context.Background(), &timeout)
done<-struct{}{}
}()
select {
case<-done:
case<-time.After(50*time.Second): // 50 secs should be plenty for Kafka to properly handle the signalt.Fatalf("Kafka did not gracefully exit in due time")
}
}
I tried to replace /etc/confluent/docker/launch with exec /etc/confluent/docker/launch and starterScript with exec starterScript but that didn't do the trick.
The text was updated successfully, but these errors were encountered:
It could be a difference between both images cp-kafka and confluent-local images. You can raise an issue here. I also found this old issue but it is just for cp-kafka
I think the same implementation will work with confluentinc/cp-kafka but only in zookeeperless (raft) mode. IIRC, in go we decided to start with confluent-local as it is declared to be used for development workflows.
Proposal
Currently, the Kafka module spawns a container that doesn't properly handle signals (term/int). The following (next) unit test reproduces the issue:
I tried to replace
/etc/confluent/docker/launch
withexec /etc/confluent/docker/launch
andstarterScript
withexec starterScript
but that didn't do the trick.The text was updated successfully, but these errors were encountered: