[ 
https://issues.apache.org/jira/browse/GEODE-3416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16127500#comment-16127500
 ] 

ASF GitHub Bot commented on GEODE-3416:
---------------------------------------

Github user kohlmu-pivotal commented on a diff in the pull request:

    https://github.com/apache/geode/pull/702#discussion_r133238417
  
    --- Diff: 
geode-core/src/main/java/org/apache/geode/internal/net/SocketCloser.java ---
    @@ -144,35 +156,22 @@ private boolean isClosed() {
        * called then the asyncClose will be done synchronously.
        */
       public void close() {
    -    synchronized (asyncCloseExecutors) {
    +    synchronized (closed) {
           if (!this.closed) {
             this.closed = true;
    -        for (ThreadPoolExecutor pool : asyncCloseExecutors.values()) {
    -          pool.shutdown();
    -        }
    -        asyncCloseExecutors.clear();
    +      } else {
    +        return;
           }
         }
    +    for (ExecutorService executorService : asyncCloseExecutors.values()) {
    +      executorService.shutdown();
    +      asyncCloseExecutors.clear();
    --- End diff --
    
    Good catch.


> Reduce blocking for SocketCloser.asyncClose 
> --------------------------------------------
>
>                 Key: GEODE-3416
>                 URL: https://issues.apache.org/jira/browse/GEODE-3416
>             Project: Geode
>          Issue Type: Bug
>          Components: client/server
>    Affects Versions: 1.1.0, 1.1.1, 1.2.0, 1.2.1
>            Reporter: Udo Kohlmeyer
>            Assignee: Udo Kohlmeyer
>             Fix For: 1.3.0
>
>
> In the SocketCloser.asyncClose method, there is a synchronization block 
> around at HashMap. This synchronization will cause an effective 
> single-threaded processing capability when closing sockets. this effect 
> becomes more evident with a high number of clients.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to