Bug 1229181
| Summary: | Race condition in SemaphoreCompletionService.executeFront() | ||
|---|---|---|---|
| Product: | [JBoss] JBoss Data Grid 6 | Reporter: | Dan Berindei <dberinde> |
| Component: | Infinispan | Assignee: | Tristan Tarrant <ttarrant> |
| Status: | CLOSED UPSTREAM | QA Contact: | Martin Gencur <mgencur> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 6.5.0 | CC: | afield, jdg-bugs |
| Target Milestone: | ER1 | ||
| Target Release: | 6.5.1 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2025-02-10 03:47:42 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
This product has been discontinued or is no longer tracked in Red Hat Bugzilla. |
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