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

      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, 40 weeks ago