Comments (5)
Hmm, have you got a specific case when it fails? The normal sequence is GetLastChecpoint
(unconditionally), then StoreCheckpoint
. The _counters[checkpointId]
entry is initialised in GetLastCheckpoint
, so I assumed it will always work.
from eventuous.
@alexeyzimarev - I copied your Checkpoint and built my own (I didn't want to use Mongo)
readonly ConcurrentDictionary<string, int> _counters = new();
And the first occurance of this being used, as you said is GetLastCheckpoint
:
_counters[checkpointId] = 0;
I couldn't see any place where the key was initialised, i.e.:
_counters.Add(checkpointId,0);
As soon as I ran my code, I got an exception when GetLastCheckpoint attempted to update the counter which did not exist.
from eventuous.
@alexeyzimarev - clearly you are not seeing the same issue, so could it be a version problem? But a later version of this ConcurrentDictionary creates a new entry in the Dictionary rather than throw an Exception?
from eventuous.
_counters[checkpointId] = 0;
is equivalent to Add
if the dictionary entry doesn't exist. That's how dictionaries always worked. I am not sure what the issue is in your case. I've never seen it fail.
from eventuous.
@alexeyzimarev - yeah, can't argue with that. I have tried replicating the issue and no luck. My checkpoint was slightly different, and I am wondering if I had somehow managed to try and use the key before the GetLastCheckpoint init.
Insider my GetLastCheckpoint, I called another method which loaded my checkpoint from a file.
From there, I must have assumed it was what i thought was a lack of .Add being called.
Every day's a school day...
Thanks for taking the time to look at this.
from eventuous.
Related Issues (20)
- [EVE-34] Process managers HOT 2
- Links to edit markdown in GitHub's documentation are broken due to language code in path HOT 1
- Feature: The ability to fold historical events into one another (to keep the Event Store size managable) HOT 1
- [EVE-33] Race condition in ESDB subscriptions with random NullReferenceException HOT 10
- Eventuous breaks with npgsql >= 7.0.0
- [EVE-38] Subscriptions pool HOT 1
- [EVE-36] Bug: mapped commands expose the wrong contract to OpenAPI
- [EVE-39] Expose endpoint configuration for command mapping
- [EVE-43] Test issue
- [EVE-44] Support authorisation through attributes (HTTP)
- Avoid unnecessary copy of Payload and Metadata in EsdbEventStore
- Most of the AspNetCore extensions should likely be changed/moved to something more generic HOT 1
- Multitenant implementation HOT 20
- Custom queue name in RMQ gateway subscription
- Crypto Shredding Serialization/Deserialization Support
- Subscriptions sometimes skips events HOT 24
- Postgres subscription is flooding database server with polling queries HOT 3
- Postgres subscription does not automatically reconnect after database server restart HOT 1
- Promote InMemoryEventStore to the main Eventuous library
- Wrong event stream name in EventStoreDB persistent subscription events
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eventuous.