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: initialize NonEmptyTopicCharacteristics to avoid NPE #39

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

erikgb
Copy link
Member

@erikgb erikgb commented Jan 28, 2025

I noticed this in our logs, and I think the problem is that we are not enabling the terminate non-empty topic feature:

{"@timestamp":"2025-01-28T16:54:53.166610422Z","@version":"1","message":"Terminating unused topics","logger_name":"io.statnett.k3a.topicterminator.TopicTerminator","thread_name":"scheduling-2","level":"INFO","level_value":20000,"dry-run":true}
{"@timestamp":"2025-01-28T16:54:53.171310524Z","@version":"1","message":"Unexpected error occurred in scheduled task","logger_name":"org.springframework.scheduling.support.TaskUtils$LoggingErrorHandler","thread_name":"scheduling-2","level":"ERROR","level_value":40000,"stack_trace":"java.lang.NullPointerException: Cannot invoke \"io.statnett.k3a.topicterminator.ApplicationProperties$NonEmptyTopicCharacteristics.isWithoutTimeRetention()\" because the return value of \"io.statnett.k3a.topicterminator.ApplicationProperties.getNonEmptyTopics()\" is null\n\tat io.statnett.k3a.topicterminator.TopicTerminator.terminateUnusedTopics(TopicTerminator.java:54)\n\tat java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source)\n\tat java.base/java.lang.reflect.Method.invoke(Unknown Source)\n\tat org.springframework.scheduling.support.ScheduledMethodRunnable.runInternal(ScheduledMethodRunnable.java:130)\n\tat org.springframework.scheduling.support.ScheduledMethodRunnable.lambda$run$2(ScheduledMethodRu...

@erikgb erikgb requested a review from a team as a code owner January 28, 2025 17:26
@erikgb erikgb merged commit 530644c into statnett:main Jan 28, 2025
5 checks passed
@statnett-bot statnett-bot bot mentioned this pull request Jan 28, 2025
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.

2 participants