[jboss-jira] [JBoss JIRA] (JGRP-2287) Thread safety issues and race conditions in VERIFY_SUSPECT

Paul Ferraro (JIRA) issues at jboss.org
Wed Sep 12 13:15:00 EDT 2018


Paul Ferraro created JGRP-2287:
----------------------------------

             Summary: Thread safety issues and race conditions in VERIFY_SUSPECT
                 Key: JGRP-2287
                 URL: https://issues.jboss.org/browse/JGRP-2287
             Project: JGroups
          Issue Type: Bug
    Affects Versions: 4.0.13
            Reporter: Paul Ferraro
            Assignee: Bela Ban
            Priority: Critical


While addressing JGRP-2286, I noticed a number of thread safety issues and race conditions in VERIFY_SUSPECT, e.g.

1. "suspects" DelayQueue is accessed concurrently within synchronized block by most of the code, however, the run() method calls isEmpty(), size(), and most notably, drainTo(...) without sufficient exclusivity.  drainTo is particularly problematic in the case of concurrent modifications.
2. "timer" Thread is non-volatile, but its reference is set by multiple threads.
3. The startTimer() method only creates a new thread if Thread.isAlive() returns false.  However, if the thread is just completing (i.e. exiting its loop), this method can return true, and the verification of suspected members can be delayed until the next suspect event.




--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the jboss-jira mailing list