Uploaded image for project: 'JGroups'
  1. JGroups
  2. JGRP-2762

TcpConnection synchronizes on the wrong 'this'

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 5.3.3, 5.2.22
    • None
    • None
    • False
    • None
    • False

      TcpServer.handleAccept() synchronizes on this to add/remove/replace connections. However, this is TcpServer$Acceptor, which is wrong: it should be TcpServer.
      The effect is that active connections (BaseServer.getConnection() can be added to the conns hashmap while handleAccept() does the same; as the 2 methods synchronize on different locks!
      Solution: synchronized(this) --> synchronized(TcpServer.this)

              rhn-engineering-bban Bela Ban
              rhn-engineering-bban Bela Ban
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: