Page MenuHomePhorge

Duplicated tag/relation objects (race-condition)
Closed, ResolvedPublic5 Story Points

Description

Scenario: Using ActiveSync client tag many (at least two) email messages with the same new tag (category). The issue does not happen for other object types.

In such a scenario the code would call:

  1. $tags = kolab_storage_config::get_tags()
  2. if tag is not listed in $tag create a new one (kolab_storage_config::save() call)
  3. $tags = kolab_storage_config::get_tags()
  4. if tag is not listed in $tag create a new one...

Note that in 3. $tags will not contain the tag created in 2. and because there's no other checking for tag existence it will create another relation object with the same name.

Solution: kolab_storage_config::save() and kolab_storage_config::delete() should update internal $tags property which is used for "caching". Note, there's also save_tags() method that uses it.

Details

Ticket Type
Task

Event Timeline

machniak raised the priority of this task from to 60.
machniak updated the task description. (Show Details)
machniak changed Ticket Type from Task to Task.
machniak edited a custom field.
machniak subscribed.

save_tags() (or more generically, write operations) should probably invalidate the cache(s) related to it, and as a matter of efficiency, one might seed the cache again with the internal structs rather than obtain them all all over again from source.

grote lowered the priority of this task from 60 to 40.Jun 17 2015, 2:28 PM
machniak moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.
machniak moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.