Closed
Bug 722575
Opened 14 years ago
Closed 14 years ago
SerialRecordConsumer.java consumerIsDone() is not threadsafe
Categories
(Firefox for Android Graveyard :: Android Sync, defect, P3)
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla13
People
(Reporter: dchanm+bugzilla, Assigned: nalexander)
References
Details
(Whiteboard: [qa-])
consumerIsDone() reads the counter variable in a non-threadsafe manner. This isn't a huge deal since the value is only used for logging purposes.
Threads (T1, T2)
T1 calls run()
T1 obtains lock for monitor
T1 calls consumerIsDone()
T1 executes info() and checks for value of counter (let's say 0)
T1 is context switched out before ?: executes
T2 calls storeSerially()
T2 obtains lock for storeSerializer
T2 increments counter
T2 is context switched out
T1 finishes info call and logs
"Consumer is done. Processed 0 records."
since counter == 1 is now true
[1] - https://github.com/mozilla-services/android-sync/blob/develop/src/main/java/org/mozilla/gecko/sync/synchronizer/SerialRecordConsumer.java#L133
Comment 1•14 years ago
|
||
(In reply to David Chan [:dchan] from comment #0)
> This isn't a huge deal since the value is only used for logging purposes.
Yup, that's why I left it for now :D Thanks for filing, though!
Priority: -- → P3
| Assignee | ||
Comment 2•14 years ago
|
||
Comment 3•14 years ago
|
||
Assignee: nobody → nalexander
Status: NEW → ASSIGNED
Whiteboard: [fixed in services][qa-]
Comment 4•14 years ago
|
||
Comment 5•14 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
Comment 6•14 years ago
|
||
Whiteboard: [fixed in services][qa-] → [qa-]
Updated•13 years ago
|
Product: Mozilla Services → Android Background Services
Updated•9 years ago
|
Product: Android Background Services → Firefox for Android
Updated•5 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•