Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-26756

Multithreading code issues - increment to volatile int/long aren't atomic - increments could be lost

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 6.2.0 CE M2
    • Fix Version/s: --Sprint 11/12, 6.2.0 CE M2
    • Component/s: WCM
    • Environment:
      Mac OSX 10.7.3, Tomcat 6, Oracle Java EA 7u4 Mac, Apache Derby 10.8

      Description

      Bug:
      1) Increment of volatile field com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._localCompletedTaskCount in com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(Runnable)
      2) Increment of volatile field com.liferay.portal.search.lucene.IndexAccessorImpl._batchCount in com.liferay.portal.search.lucene.IndexAccessorImpl._write(Term, Document)
      3) Increment of volatile field com.liferay.portal.search.lucene.IndexAccessorImpl._batchCount in com.liferay.portal.search.lucene.IndexAccessorImpl.deleteDocuments(Term)

      code increments a volatile field. Increments of volatile fields aren't atomic. If more than one thread is incrementing the field at the same time, increments could be lost.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                5 years, 10 weeks, 1 day ago

                Subcomponents