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

Race condition in BaseServer.getConnection

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 4.0.12, 3.6.16
    • 3.6.10
    • None

    Description

      BaseServer.getConnection creates a socket and puts it in the shared map under a lock.

      However it does not connect the socket inside the lock, so another thread calling getConnection at the same time can get the unconnected socket, which will throw a NPE when used because it's not connected yet (all the checks before returning and using it only look for isOpen, not isConnected).

      java.lang.NullPointerException
      at org.jgroups.blocks.cs.TcpConnection.doSend(TcpConnection.java:184)
      at org.jgroups.blocks.cs.TcpConnection._send(TcpConnection.java:171)
      at org.jgroups.blocks.cs.TcpConnection.send(TcpConnection.java:141)
      at org.jgroups.blocks.cs.BaseServer.send(BaseServer.java:185)

      Attachments

        Activity

          People

            rhn-engineering-bban Bela Ban
            rhn-support-dereed Dennis Reed
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: