Description
When using create().orSetData().creatingParentsIfNeeded().forPath(path, data), a race condition exists that will ignore the orSetData() option if parents aren't created.
So if there are two parallel processes creating the same node with the settings above, both will hit a "NoNodeException", which will take them down the path of creating the parents. Once both are done with that, which seems to handle the parallelism fine, they will both try to create the target zNode (path above). However, in this code path, the orSetData() option is not used, so one will succeed, and create the zNode, and the other will fail because the zNode has already been created by the other process.
What should happen, is that the orSetData() option is used in this catch (NoNodeException) block, and the second process will set the data and not throw an error.
Attachments
Issue Links
- links to