cortoproject / corto

A hierarchical object store for connecting realtime machine data with web applications, historians & more
https://www.corto.io
MIT License
87 stars 14 forks source link

Creating objects recursively of void type can generate invalid DEFINE events #609

Closed SanderMertens closed 7 years ago

SanderMertens commented 7 years ago

When creating multiple void objects with a single corto_declareChild or corto_createChild call and one of the object creations fail, DEFINE events might already have been generated. This is because a void object is instantly defined when it is declared.

However, this behavior is incorrect in this scenario, as the store should treat corto_declareChild and corto_createChild as atomic operations, thus if creation of one object fails, there should be no side effects.

In addition to fixing this behavior, the API will change to create void objects for intermediately created objects. For example, the following statement:

corto_createChild(root_o, "a/b/c", corto_int32_o);

will create:

This behavior makes more sense as it is more likely to match the intent of a user than the previous behavior (which was to create all objects as int32).