Skip to main content
Solved

Race conditions on event updates


Forum|alt.badge.img

Hey,

 

To what extent does CDF handle possible race-condition triggering situations like the update of an object from two different systems?

The example we are currently considering is whether a disjoint set of metadata on objects (events) can be updated without regard to timing.

 

/Robert

Best answer by Andreas Korneliussen

We handle race conditions by applying concurrent updates sequentially. For two concurrent updates A and B, the result would be the same as applying A and then B, or B and then A. You can safely push simultaneous updates, without regards to race conditions.

View original
Did this topic help you find an answer to your question?

3 replies

Anita Hæhre
Seasoned Practitioner
Forum|alt.badge.img+1
  • Head of Academy and Community
  • 586 replies
  • May 20, 2021

Hi Robert! Thanks for your question. We would need some more details on the race-condition concerns, like an example of sequence of operations with ambiguous/erroneous/tricky behavior. Would you be able to provide it? 


Forum|alt.badge.img
  • Author
  • Seasoned
  • 17 replies
  • May 20, 2021

Hi Anita, sure let’s see about an example. To be clear, we’re in the design phase of this service. So our question is mostly “does this raise any red flags” from your engineers. 

 

We have two services, one which produces and updates events on conditions in data. And another which consumes and updates events for communication to another system. In sum, a somewhat complex data-monitoring tool.

The type of sequence of operations we’re concerned about (we’re still drawing architecture for “who” owns  what part of the monitoring process) is: 

Let the event in question, E, have the following two metadata fields:

{"communicated": "foo", "status": "bar"}

 

Let A be the monitor which produces events, and updates the field “status” in the event. 

Let B be the consumer who listens for events, and updates the field “communicated” in the event.

Can we push updates to E from both A and B simultaneously - without regard to potential race-condition problems, or the like? 

 

Thanks, 

Robert


We handle race conditions by applying concurrent updates sequentially. For two concurrent updates A and B, the result would be the same as applying A and then B, or B and then A. You can safely push simultaneous updates, without regards to race conditions.


Reply


Cookie Policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings