question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

InMemoryWindowStore System.NullReferenceException

See original GitHub issue

Description

When I try to reprocess the messages from earliest offset of a topic that is populating an InMemoryWindowStore, while restoring state and trying to skip record for expired segment, the library crashes on a NullReferenceException. In the class InMemoryWindowStore.cs method Put() line 351, the context.Timestamp variable is NULL. Code : if (windowStartTimestamp <= observedStreamTime - retention.TotalMilliseconds) { expiredRecordSensor.Record(1.0, context.Timestamp); logger.LogWarning("Skipping record for expired segment"); }

How to reproduce

  1. Setup a source topic called topic and produce messages to the topic with historical timestamps. Meaning some messages should have timestamp in Feb 2023, some in March 2023, some in April 2023 and finally some messages with current timestamp.
  2. Setup a simple windowed aggregation and write the results of the aggregation to an InMemoryWindows store.
  3. Setup an application Id.
  4. Run the app and let it process to the latest offset.
  5. Reset the offset to earliest for the application Id/consumer group.
  6. Restart the application to process messages. Program.txt

Checklist

Please provide the following information:

  • [ DONE] A complete (i.e. we can run it), minimal program demonstrating the problem. No need to supply a project file.
  • [DONE-Inside attached program] A code snippet with your topology builder (ex: builder.Stream<string, string>(“topic”).to(“an-another-topic”)😉
  • [1.4.2] Streamiz.Kafka.Net nuget version.
  • Apache Kafka version.
  • [ DONE-Inside attached program] Client configuration.
  • [Linux ] Operating system.
  • [ logs.txt ] Provide logs (with in debug mode (log4net and StreamConfig.Debug) as necessary in configuration).
  • [Yes] Critical issue.

Issue Analytics

  • State:closed
  • Created 2 months ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mayur-raocommented, Jul 12, 2023

Hi @LGouellec

I did a restart of my application and after that no longer running into the thread exception. So please close this issue. I will report back if see an issue again.

Again, I thank you for your quick response and time spent.

0reactions
LGouelleccommented, Jul 12, 2023

@mayur-rao ,

Can you share the GlobalTable topology please ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

System Null Reference Exception while using a simple ...
While testing out a consumer locally. I keep getting System.NullReferenceException Exception: System.NullReferenceException Message: Object ...
Read more >
NullReferenceException in C# when dealing with Streams?
I'm building a client-server chat application, wherein the server is running, the client(s) connect(s) to the server, and then when a client ...
Read more >
kafka-streams-dotnet
gitpod doesn't work properly · InMemoryWindowStore System.NullReferenceException · De-duplication feature · Transformer not working as expected in 1.5.0-RC1.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found