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)

ARM
Android
defect

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
(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
Blocks: 723230
Assignee: nobody → nalexander
Status: NEW → ASSIGNED
Whiteboard: [fixed in services][qa-]
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
Whiteboard: [fixed in services][qa-] → [qa-]
Product: Mozilla Services → Android Background Services
Product: Android Background Services → Firefox for Android
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.