[
https://issues.apache.org/jira/browse/GEODE-6794?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16852000#comment-16852000
]
ASF subversion and git services commented on GEODE-6794:
--------------------------------------------------------
Commit 1463cb4cc69c897b31c8bc94f47473d5e68d6137 in geode's branch
refs/heads/develop from mkevo
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=1463cb4 ]
GEODE-6794: optimize returning client pooled coonection
Now notifyAll is only called if some other thread is waiting to be notified.
> Returning a client connection to the pool always calls notifyAll
> ----------------------------------------------------------------
>
> Key: GEODE-6794
> URL: https://issues.apache.org/jira/browse/GEODE-6794
> Project: Geode
> Issue Type: Improvement
> Components: client/server
> Reporter: Darrel Schneider
> Assignee: Mario Kevo
> Priority: Major
> Labels: performance
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> The PooledConnection passivate method is called every time a client op
> completes and it is returning its connection to the pool.
> passivate almost always calls notifyAll. But no other thread will be waiting
> for this notify unless the boolean "waitingToSwitch" is true. This notifyAll
> calls shows up as a hotspot in profiling. But when I got rid of it it didn't
> make any difference in client operation throughput.
> Here is the change that can be made to get rid of the notifyAll calls:
> {noformat}
> ---
> a/geode-core/src/main/java/org/apache/geode/cache/client/internal/pooling/PooledConnection.java
> +++
> b/geode-core/src/main/java/org/apache/geode/cache/client/internal/pooling/PooledConnection.java
> @@ -157,7 +157,9 @@ public class PooledConnection implements Connection {
> throw new InternalGemFireException("Connection not active");
> }
> this.active = false;
> - notifyAll();
> + if (this.waitingToSwitch) {
> + notifyAll();
> + }
> if (accessed) {
> this.lastAccessed = now; // do this while synchronized
> }
> {noformat}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)