Bug 294205 - Job's get/set property is not threadsafe
Summary: Job's get/set property is not threadsafe
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Runtime (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: platform-runtime-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 293973
  Show dependency tree
 
Reported: 2009-11-04 09:57 EST by Min Idzelis CLA
Modified: 2019-09-06 16:16 EDT (History)
2 users (show)

See Also:
min123: review? (john.arthorne)


Attachments
set property patch v1 (12.53 KB, patch)
2009-11-05 20:14 EST, Min Idzelis CLA
no flags Details | Diff
get/set patch v2 (14.50 KB, patch)
2009-11-06 10:46 EST, Min Idzelis CLA
no flags Details | Diff
putIfAbsent v3 (14.51 KB, patch)
2010-04-06 11:25 EDT, Min Idzelis CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Min Idzelis CLA 2009-11-04 09:57:40 EST
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.4) Gecko/20091016 Firefox/3.5.4
Build Identifier: 

If multiple threads try to set properties on a job at the same time, not all properties will be set. Some synchronization is necessary. 

I propose giving the ObjectMap that stores properties CopyOnWrite semantics. 

Reproducible: Always
Comment 1 Min Idzelis CLA 2009-11-05 20:14:02 EST
Created attachment 151520 [details]
set property patch v1

Modified OrderedMap to use copy-on-write. Preserved backward compatibility: added setProperty2(QualifiedName, Object) It is not compatible to change return type. 

btw, I manually edited this patch to remove some overlapping edits. lets see how it goes.
Comment 2 Min Idzelis CLA 2009-11-06 10:46:37 EST
Created attachment 151571 [details]
get/set patch v2

Renamed setProperty2 to setPropertyIfAbsent() which adds an atomic operation. (Set a property if not already set) 

This is necessary for accurate property setting from multiple threads at once. 

Added javadoc and @since tag. 

This patch is ready to go. Please review.
Comment 3 Min Idzelis CLA 2010-04-06 11:25:30 EDT
Created attachment 163917 [details]
putIfAbsent v3

Updated patch so it applies cleanly to latest 3.6M6 changes.
Comment 4 Eclipse Webmaster CLA 2019-09-06 16:16:54 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.