Bug 1229181 - Race condition in SemaphoreCompletionService.executeFront()
Summary: Race condition in SemaphoreCompletionService.executeFront()
Keywords:
Status: VERIFIED
Alias: None
Product: JBoss Data Grid 6
Classification: JBoss
Component: Infinispan
Version: 6.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ER1
: 6.5.1
Assignee: Tristan Tarrant
QA Contact: Martin Gencur
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-06-08 08:59 UTC by Dan Berindei
Modified: 2022-05-31 22:24 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker ISPN-5524 0 Blocker Resolved Race condition in SemaphoreCompletionService.executeFront() 2016-07-15 17:09:09 UTC

Description Dan Berindei 2015-06-08 08:59:36 UTC
If two threads call executeFront() at the same time, it's possible that none of them executes any task, although there are permits available, and one of the threads just added a task in the queue. This scenario causes random initial state transfer timeouts in the testsuite:

    T1: continueTaskInBackground(): queue = empty, permits = 0
    T1: backgroundTaskFinished()
    T1: = semaphore.release(): queue = empty, permits = 1
    T1: = executeFront()
    T1: == semaphore.acquire() -> true: queue = empty, permits = 0
    T2: == queue.poll() -> null
    T2: submit(task)
    T2: = executeFront()
    T2: == semaphore.acquire() -> false
    T2: return without executing any task
    T1: return without executing any task


Note You need to log in before you can comment on or make changes to this bug.