InMemoryWindowStore System.NullReferenceException
See original GitHub issueDescription
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
- 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.
- Setup a simple windowed aggregation and write the results of the aggregation to an InMemoryWindows store.
- Setup an application Id.
- Run the app and let it process to the latest offset.
- Reset the offset to earliest for the application Id/consumer group.
- 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:
- Created 2 months ago
- Comments:6 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
@mayur-rao ,
Can you share the GlobalTable topology please ?