Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flaky Cruise Control test and fix error when RF is not configured #9674

Merged
merged 1 commit into from Feb 13, 2024

Conversation

scholzj
Copy link
Member

@scholzj scholzj commented Feb 11, 2024

Type of change

  • Bugfix

Description

#9471 introduced a flaky test caused by inconsistent ordering of the Cruise Control configuration. There is also a bug when the default replication factor is not configured in the Kafka CR:

java.lang.NullPointerException: Cannot invoke "String.length()" because "v" is null
	at io.strimzi.operator.common.model.OrderedProperties$PropertiesWriter.escapeValue(OrderedProperties.java:509) ~[io.strimzi.operator-common-0.40.0-SNAPSHOT.jar:0.40.0-SNAPSHOT]
	at io.strimzi.operator.common.model.OrderedProperties$PropertiesWriter.write(OrderedProperties.java:461) ~[io.strimzi.operator-common-0.40.0-SNAPSHOT.jar:0.40.0-SNAPSHOT]
	at io.strimzi.operator.common.model.OrderedProperties$PropertiesWriter.write(OrderedProperties.java:443) ~[io.strimzi.operator-common-0.40.0-SNAPSHOT.jar:0.40.0-SNAPSHOT]
	at io.strimzi.operator.common.model.OrderedProperties$PropertiesWriter.writeString(OrderedProperties.java:429) ~[io.strimzi.operator-common-0.40.0-SNAPSHOT.jar:0.40.0-SNAPSHOT]
	at io.strimzi.operator.common.model.OrderedProperties.asPairsWithComment(OrderedProperties.java:143) ~[io.strimzi.operator-common-0.40.0-SNAPSHOT.jar:0.40.0-SNAPSHOT]
	at io.strimzi.operator.common.model.OrderedProperties.asPairs(OrderedProperties.java:130) ~[io.strimzi.operator-common-0.40.0-SNAPSHOT.jar:0.40.0-SNAPSHOT]
	at io.strimzi.operator.cluster.model.CruiseControl.generateConfigMap(CruiseControl.java:544) ~[io.strimzi.cluster-operator-0.40.0-SNAPSHOT.jar:0.40.0-SNAPSHOT]
	at io.strimzi.operator.cluster.operator.assembly.CruiseControlReconciler.lambda$configMap$7(CruiseControlReconciler.java:189) ~[io.strimzi.cluster-operator-0.40.0-SNAPSHOT.jar:0.40.0-SNAPSHOT]
	at io.vertx.core.impl.future.Composition.onSuccess(Composition.java:38) ~[io.vertx.vertx-core-4.5.3.jar:4.5.3]
	at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:66) ~[io.vertx.vertx-core-4.5.3.jar:4.5.3]
	at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:246) ~[io.vertx.vertx-core-4.5.3.jar:4.5.3]
	at io.vertx.core.impl.future.Mapping.onSuccess(Mapping.java:40) ~[io.vertx.vertx-core-4.5.3.jar:4.5.3]
	at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:66) ~[io.vertx.vertx-core-4.5.3.jar:4.5.3]
	at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:246) ~[io.vertx.vertx-core-4.5.3.jar:4.5.3]
	at io.vertx.core.impl.future.CompositeFutureImpl.complete(CompositeFutureImpl.java:172) ~[io.vertx.vertx-core-4.5.3.jar:4.5.3]
	at io.vertx.core.impl.future.CompositeFutureImpl.lambda$join$3(CompositeFutureImpl.java:109) ~[io.vertx.vertx-core-4.5.3.jar:4.5.3]
	at io.vertx.core.impl.future.FutureImpl$4.onSuccess(FutureImpl.java:176) ~[io.vertx.vertx-core-4.5.3.jar:4.5.3]
	at io.vertx.core.impl.future.FutureBase.lambda$emitSuccess$0(FutureBase.java:60) ~[io.vertx.vertx-core-4.5.3.jar:4.5.3]
	at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173) ~[io.netty.netty-common-4.1.106.Final.jar:4.1.106.Final]
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166) ~[io.netty.netty-common-4.1.106.Final.jar:4.1.106.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) ~[io.netty.netty-common-4.1.106.Final.jar:4.1.106.Final]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569) ~[io.netty.netty-transport-4.1.106.Final.jar:4.1.106.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[io.netty.netty-common-4.1.106.Final.jar:4.1.106.Final]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[io.netty.netty-common-4.1.106.Final.jar:4.1.106.Final]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[io.netty.netty-common-4.1.106.Final.jar:4.1.106.Final]
	at java.lang.Thread.run(Thread.java:840) ~[?:?]

It also moves the handling of the default options to the AbstractConfiguration class and the capacity.config.file to the shell script as that is a forbidden option.

Checklist

  • Make sure all tests pass
  • Try your changes from Pod inside your Kubernetes and OpenShift cluster, not just locally

Signed-off-by: Jakub Scholz <www@scholzj.com>
@scholzj scholzj added this to the 0.40.0 milestone Feb 11, 2024
@scholzj
Copy link
Member Author

scholzj commented Feb 11, 2024

/azp run regression

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@scholzj scholzj merged commit 51486c7 into strimzi:main Feb 13, 2024
21 checks passed
@scholzj scholzj deleted the fix-flaky-cc-test branch February 13, 2024 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants