I've opened up an issue in Jira to request a change to reduce the freqency of calls to BoundedBuffer.size() in Region.putNodeEvent().
The problem is that BoundedBuffer.size() is not a cheap call - requires a lock acquisition - and since there is high contention for this object across threads, this leads to concurrency problems.
I've attached an enhanced Region.java file that makes the call only once every 100 calls.
Looks like a good suggestion. But I will make a minor correction to your patch by subtracting the THRESHOLD for another 100 to guard against the overflow, just in case.
BTW, it seems you have some profiling information. Would you mind to share it with us. If you prefer, my email address is ben.wang at jboss dot com.