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

Event Sourced State has 2k events in it causing Out of Memory Error #138

Open
cross311 opened this issue Jun 19, 2020 · 1 comment
Open
Labels
enhancement New feature or request M-core This issue is related to the core module P2 Priority 2
Milestone

Comments

@cross311
Copy link
Collaborator

Had an infinite add event to stream issue due to listening to cosmos change feed and not marking event in the state as handled, so it kept putting the same event back on the state. Eventually, it got to the point where it has 2.4K events on the event stream, which then when CC reads in causes an Out Of Memory Crash.

I am wondering if there should be some sort of warning / error that cookie cutter should throw when state gets to big, number of evens or total memory used for a stream. And the error reports the stream that caused the issue, else it is kinda hard to track down which stream read caused the out of memory?

Another possibility is to warn if source event making new event is exactly the same and the source even is from the event stream, to catch infinite event adds like this? Happens when the service listens to its changefeed and also listens to another Kafka topic for an event then puts that event directly on its own stream with no real changes. You can see in cosmos the source metadata is stream id for the current stream and sn is the event before it, over and over again.

@sklose sklose added enhancement New feature or request M-core This issue is related to the core module labels Jun 26, 2020
@sklose sklose added this to the 1.3 milestone Jun 26, 2020
@sklose
Copy link
Collaborator

sklose commented Jun 26, 2020

Add metrics to State Provider:

  • number of events read per stream
  • snapshot size + event payload sizes

Potentially read + apply events in chunks to prevent OOM

@sklose sklose modified the milestones: 1.3, 1.4 Oct 13, 2020
@plameniv plameniv added the P2 Priority 2 label Jul 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request M-core This issue is related to the core module P2 Priority 2
Development

No branches or pull requests

3 participants