Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

concurrency issue on tag handling #5654

Closed
maggu2810 opened this issue May 30, 2018 · 1 comment · Fixed by #5652
Closed

concurrency issue on tag handling #5654

maggu2810 opened this issue May 30, 2018 · 1 comment · Fixed by #5652

Comments

@maggu2810
Copy link
Contributor

On reading the changes of #5652 it seems that the whole implementation does not respect concurrency.

We miss synchronization blocks in all the tag handling methods.

If two clients manage the tags of the same item the behavior if not deterministic.

Assume you call remote tags with an item name and a collection of tags to remove.

  • the tags are retrieved
  • the retrieved tags are modified
  • the modified tags are written

If this method is called e.g. by different users of a Web UI at the same time the "get, modify, set" procedure could be interrupted and ...

@sjsf
Copy link
Contributor

sjsf commented May 30, 2018

Valid point, indeed!

sjsf pushed a commit to sjsf/smarthome that referenced this issue May 30, 2018
maggu2810 pushed a commit that referenced this issue May 30, 2018
* Allow tag deletion of missing item

Whenever a non-managed item was removed, the removal of its
tags should still be possible without the need to hook into
any of the item registries lifecycle methods.
Metadata has its own lifecycle, so tags should do too.

Also, this adapts the signature of

  ItemRegistry.removeTags(String)

to return a boolean like all the other tag related methods do.

* adapt ItemUIRegistryImpl
* added locking to tag related methods

fixes #5649
fixes #5654
Signed-off-by: Simon Kaufmann <[email protected]>
ermartens pushed a commit to ermartens/smarthome that referenced this issue Jun 15, 2018
* Allow tag deletion of missing item

Whenever a non-managed item was removed, the removal of its
tags should still be possible without the need to hook into
any of the item registries lifecycle methods.
Metadata has its own lifecycle, so tags should do too.

Also, this adapts the signature of

  ItemRegistry.removeTags(String)

to return a boolean like all the other tag related methods do.

* adapt ItemUIRegistryImpl
* added locking to tag related methods

fixes eclipse-archived#5649
fixes eclipse-archived#5654
Signed-off-by: Simon Kaufmann <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants